Attenzione!

Questo articolo contiene codice PHP ed è destinato agli sviluppatori. Offriamo questo codice come cortesia, ma non forniamo supporto per personalizzazioni del codice o sviluppo di terze parti.

Per ulteriore assistenza, consulta il tutorial di WPBeginner su come aggiungere codice personalizzato.

Chiudi

Descrizione

The wpforms_upload_root filter is used to define the directory on the server where files uploaded through WPForms are stored.

Parametri

$wpforms_upload_root
(string) URL used for the default path of storing files uploaded through WPForms.

Origine

wpforms/includes/functions/filesystem-media.php

Maggiori Informazioni

The wpforms_upload_root filter can be used to define where the files uploaded through WPForms are stored.

Esempio

/**
 * Change the path where file uploads are stored in WPForms.
 *
 * @link    https://wpforms.com/developers/wpforms_upload_root/
 *
 * @param   string  $wpforms_upload_root  root path of where file uploads will be stored.
 * @return  string
 */

function wpf_dev_upload_root( $wpforms_upload_root ) {
 
    //Define the path for your file uploads here
    $wpforms_upload_root = '/home/mysitedomain/public_html/custom-dir';  
        
    return $wpforms_upload_root;
       
}
add_filter( 'wpforms_upload_root', 'wpf_dev_upload_root', 10, 1 );

This change will change the location of where the files are stored. This will not update the email notification URL.

Article Reference: How to Define a Specific Directory For File Uploads