Forked from Shelob9/caldera_forms_private_upload_directory.php
Created
September 18, 2019 15:59
-
-
Save gianghl1983/308d2c2b5e8ba14e6424ba3f4ee3e17e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'caldera_forms_private_upload_directory', function( $directory, $field_id, $form_id, $transient_id ){ | |
//IMPORTANT -- Change this to the ID of your field, or remove this conditional to affect all fields. | |
if( 'fld111' === $field_id ){ | |
//see: https://developer.wordpress.org/reference/functions/wp_get_upload_dir/ | |
$uploads = wp_get_upload_dir(); | |
$directory = $uploads[ 'basedir' ] . '/somepath'; | |
} | |
return $directory; | |
},10,4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment