I like to change the media upload directory for my custom plugin. Now i am testing with this in functions.php
function custom_upload_directory( $args ) {
// Check for our plugin pages
if (($_GET['page']=="contender_add") || ($_GET['page']=="contender_edit")){
$args['path'] = plugin_dir_path(__FILE__) . "uploads/test";
$args['url'] = plugin_dir_url(__FILE__) . "uploads/test";
$args['basedir'] = plugin_dir_path(__FILE__) . "uploads/test";
$args['baseurl'] = plugin_dir_url(__FILE__) . "uploads/test";
}
return $args;
}
add_filter( 'upload_dir', 'custom_upload_directory' );
Also how do add my custom upload folder to the media uploader library tab?
Regards
IN YOUR wp-config.php
And change values for this vars :