2 replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
source | link

This is a bit out of context but I think you can approach it a little bit differently, you can limit access to default media library for roles below "admin" or "editor" depending on your setup. For instance you can block authors from uploading files to media library using the following code..

if ( current_user_can('author') && current_user_can('upload_files') )
add_action('admin_init', 'remove_author_uploads');

function remove_author_uploads() {
    $author = get_role('author');
    $author->remove_cap('upload_files');
}

Then allow them to upload to media library from a front-end page on the site. Here is a good reference to that http://wordpress.stackexchange.com/questions/4307/how-can-i-add-an-image-upload-field-directly-to-a-custom-write-panel/4413#4413How can I add an image upload field directly to a custom write panel?

This is a bit out of context but I think you can approach it a little bit differently, you can limit access to default media library for roles below "admin" or "editor" depending on your setup. For instance you can block authors from uploading files to media library using the following code..

if ( current_user_can('author') && current_user_can('upload_files') )
add_action('admin_init', 'remove_author_uploads');

function remove_author_uploads() {
    $author = get_role('author');
    $author->remove_cap('upload_files');
}

Then allow them to upload to media library from a front-end page on the site. Here is a good reference to that http://wordpress.stackexchange.com/questions/4307/how-can-i-add-an-image-upload-field-directly-to-a-custom-write-panel/4413#4413

This is a bit out of context but I think you can approach it a little bit differently, you can limit access to default media library for roles below "admin" or "editor" depending on your setup. For instance you can block authors from uploading files to media library using the following code..

if ( current_user_can('author') && current_user_can('upload_files') )
add_action('admin_init', 'remove_author_uploads');

function remove_author_uploads() {
    $author = get_role('author');
    $author->remove_cap('upload_files');
}

Then allow them to upload to media library from a front-end page on the site. Here is a good reference to that How can I add an image upload field directly to a custom write panel?

1
source | link

This is a bit out of context but I think you can approach it a little bit differently, you can limit access to default media library for roles below "admin" or "editor" depending on your setup. For instance you can block authors from uploading files to media library using the following code..

if ( current_user_can('author') && current_user_can('upload_files') )
add_action('admin_init', 'remove_author_uploads');

function remove_author_uploads() {
    $author = get_role('author');
    $author->remove_cap('upload_files');
}

Then allow them to upload to media library from a front-end page on the site. Here is a good reference to that http://wordpress.stackexchange.com/questions/4307/how-can-i-add-an-image-upload-field-directly-to-a-custom-write-panel/4413#4413