Support General Change Destination Of Custom File Upload Field Type Reply To: Change Destination Of Custom File Upload Field Type

#13476
Anh TranAnh Tran
Keymaster

Hi,

To avoid the complexity, I avoided using predefined variables for things like site number in multisite network. But you can always do that with a little code, like this:

function prefix_get_site_upload_dir() {
    return WP_CONTENT_DIR . '/uploads/sites/' . get_current_blog_id() . '/my_uploads/';
}

And in the field settings, set:

'upload_dir' => prefix_get_site_upload_dir(),