Filters

feuGT_upload_override

If you wish to override the base dir for the upload directory (by default wordpress base dir is: /wp-content/uploads/) you can use this filter.

Accepts 1 parameter:
$param – Current wp_upload_dir();

Example:

function feuGT_upload_override_test($param){
global $feuGT_options;
$param['path'] = WP_CONTENT_DIR.'/custom_uploads'.$feuGT_options['general']['uploadFolder']['value']; //REQUIRED FOR VALID CHANGE
$param['url'] = WP_CONTENT_URL.'/custom_uploads'.$feuGT_options['general']['uploadFolder']['value']; //REQUIRED FOR VALID CHANGE
return $param;
}

If for example we defined our FRONTEND UPLOAD – UPLOAD FOLDER Option in the backoffice to “/simple_uploads” the new upload directory will be:

/wp_content/custom_uploads/simple_uploads/

feugt_onuploadsuccess_js

This filter is usede right after an Ajax response of a successful upload. It’s useful in case you wish to add custom jquery after successful upload.

You can use 3 javascript variables returned after a successful upload
file – contains all information about the uploaded file
data – contains all data outputted
response – contains response about the uploaded file ( true or false )

Example:


function feuGT_onuploadsuccess_jss(){
return 'console.log("uploaded!"); console.log(file);';
}

add_filter('feugt_onuploadsuccess_js', 'feuGT_onuploadsuccess_jss');

Leave a Reply