Hello,
Thank you. Yes that is possible with the following code to your child theme’s functions file:
function afu_filter_upload_dir( $dir ) {
return array(
'path' => ABSPATH . '/my_uploads_folder', // or $dir['basedir'] . folder
'url' => home_url() . '/my_uploads_folder', // or $dir['basedir'] . folder
'subdir' => '/afu',
) + $dir;
}
function afu_do_filter_upload_dir() {
if ( ! empty( $_REQUEST['action'] ) ) {
if ( 'ajax_file_upload' == $_REQUEST['action'] ) {
add_filter( 'upload_dir', 'afu_filter_upload_dir' );
}
}
}
add_action( 'init', 'afu_do_filter_upload_dir', 999 );
Make sure to set the appropriate folder path and url, and the subdir (sub directory) if needed and please test it out.
Let me know how it goes.
Thank you!
Samuel