iphorm_upload_absolute_path

This documentation page is for Quform version 1 and may not be applicable for Quform 2 click here to visit the documentation for Quform 2.

This filter hook is called when each uploaded file is processed. It can be used to modify the path to save uploaded files. This hook can be used to set the upload path outside of the WordPress uploads folder, however the links to the files you are sent in the notification email and when viewing the entry will not work correctly, this is a current limitation of the plugin. If you want the links to work, the upload folder needs to be inside the WP uploads folder and you can set the path in the Form Builder at File Upload element → Settings → Optional → Path to save uploaded files.

When using this hook to modify the path the links to the files you are sent in the notification email and when viewing the entry will not work correctly, this is a current limitation of the plugin. So you should only use this hook if you want to move the files outside the WP uploads folder and you don’t care that the links to the files do not work.

iphorm_upload_absolute_path

This hook is run for all uploaded file for all forms.

Example

This code can be added to your theme functions.php file or create a plugin for it.

1
2
3
4
5
6
7
function my_upload_absolute_path($path, $element)
{
    // Custom code
 
    return $path;
}
add_filter('iphorm_upload_absolute_path', 'my_upload_absolute_path', 10, 2);
function my_upload_absolute_path($path, $element)
{
    // Custom code

    return $path;
}
add_filter('iphorm_upload_absolute_path', 'my_upload_absolute_path', 10, 2);

Parameters

  • $path – the current path to upload the files
  • $element – the iPhorm_Element_File instance that is current being processed

Note: to get the iPhorm instance you can use the code $form = $element->getForm();

Accessing form data

See Getting form values

iphorm_upload_absolute_path_X

This filter hook is called for all uploaded files in a single form, replace X with the form ID.

Example

This code can be added to your theme functions.php file or create a plugin for it.

1
2
3
4
5
6
7
function my_upload_absolute_path($path, $element)
{
    // Custom code
 
    return $path;
}
add_filter('iphorm_upload_absolute_path_1', 'my_upload_absolute_path', 10, 2);
function my_upload_absolute_path($path, $element)
{
    // Custom code

    return $path;
}
add_filter('iphorm_upload_absolute_path_1', 'my_upload_absolute_path', 10, 2);

Parameters

  • $path – the current path to upload the files
  • $element – the iPhorm_Element_File instance that is current being processed

Note: to get the iPhorm instance you can use the code $form = $element->getForm();

Accessing form data

See Getting form values

Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy