fluentform_uploaded_file_name

Description  #

This filter returns the file names for uploaded files. Make sure to keep it unique.

apply_filters('fluentform_uploaded_file_name', $file, $originalFileArray, $this->formData, $this->form);

Usage   #

add_filter('fluentform_uploaded_file_name', function ($file, $originalFileArray, $formData, $form) {
    $prefix = 'ff-' . md5(uniqid(rand())) .'-ff-';
    $file['name'] = $prefix . $file['name'];
    return $file
}, 10, 4);

Parameters #

  • $file (array) File Data
  • $originalFileArray (array) Original File Data
  • $formData (array) Form Data
  • $form (object) Form Object

Placement #

This code should be placed in the functions.php file of your active theme.

Source Code #

This filter is located in the pro version src/Uploader.php

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *