New Year Offer - 20% OFF - Unlock Deal

wsf_dropzonejs_upload_path

Description

The wsf_dropzonejs_upload_path filter allows you to change the default upload location for DropzoneJS uploads for the File field.

The path should be relative to the standard WordPress upload folder.

For example, if you return:

my-folder

The upload path would be:

<WordPress root>/wp-content/uploads/my-folder

Usage

add_filter( 'wsf_dropzonejs_upload_path', 'my_hook_function', 10, 4 );

Parameters

  1. $file_path String
    Absolute path to the DropzoneJS uploads.
  2. $ws_form_upload_dir String
    Default WS Form upload directory.
  3. $form_id Integer
    The form ID.
  4. $field_id String
    The field ID.

Example

// Callback function for the wsf_dropzonejs_upload_path filter hook
function my_hook_function( $file_path, $ws_form_upload_dir, $form_id, $field_id ) {
	
	// Your code here ...

	// Return value
	return $file_path;
}

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

Source File

This hook can be found in: <plugin root>/api/class-ws-form-api-field.php