wsf_action_email_attachments

Description

The wsf_action_email_attachments filter allows you to modify the Attachments array of absolute file paths when sending emails using the Send Email action.

Usage

add_filter( 'wsf_action_email_attachments', 'my_hook_function', 10, 5 );

Parameters

  1. $attachments Array
    Any array of absolute file paths.
  2. $form Form Object
    The form object.
  3. $submit Submit Object
    The submit object.
  4. $action Array
    The action configuration.
  5. $temp_path String
    The temporary path WS Form is using for file attachments.

Example

// Callback function for the wsf_action_email_attachments filter hook
function my_hook_function( $attachments, $form, $submit, $action, $temp_path ) {
	
	// Your code here ...

	// Return value
	return $attachments;
}

// Add a callback function for the wsf_action_email_attachments filter hook
add_filter( 'wsf_action_email_attachments', 'my_hook_function', 10, 5 );

Source File

This hook can be found in: <plugin root>/includes/actions/class-ws-form-action-email.php