Created
July 22, 2019 15:04
-
-
Save Shelob9/90dabafd7b03e0a6cceb6bb391f94ebc 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