quform_upload_filename

This hook can be used to alter the filename of a file when it is uploaded.

quform_upload_filename_X_X

This hook is run for a single element.

Example

12
3
4
5
add_filter('quform_upload_filename_1_3', function ($filename, array $file, Quform_Element_File $element, Quform_Form $form) {    $filename = 'my-new-filename';
 
    return $filename;
}, 10, 4);
add_filter('quform_upload_filename_1_3', function ($filename, array $file, Quform_Element_File $element, Quform_Form $form) {
    $filename = 'my-new-filename';

    return $filename;
}, 10, 4);
  • On line 1, replace 1_3 with the File Upload element unique ID
1
2
3
4
5
6
7
function my_quform_upload_filename($filename, array $file, Quform_Element_File $element, Quform_Form $form)
{
    $filename = 'my-new-filename';
 
    return $filename;
}
add_filter('quform_upload_filename_1_3', 'my_quform_upload_filename', 10, 4);
function my_quform_upload_filename($filename, array $file, Quform_Element_File $element, Quform_Form $form)
{
    $filename = 'my-new-filename';

    return $filename;
}
add_filter('quform_upload_filename_1_3', 'my_quform_upload_filename', 10, 4);
  • On line 7, replace 1_3 with the File Upload element unique ID

Parameters

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