Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Remove Media Library Tab
- add_filter('media_upload_tabs','remove_medialibrary_tab');
- function remove_medialibrary_tab($tabs) {
- if (isset($_GET['YOUR_CPT']) && $_GET['post_type'] == 'YOUR_CPT') {
- unset($tabs["type_url"]);
- unset($tabs['library']);
- unset($tabs['nextgen']); //Se o plugin NextGen Gallery estiver ativado!
- return $tabs;
- }
- }
- /*Outras verificações podem ser feitas, como por exemplo, nivel de usuário
- No exemplo abaixo, SOMENTE remove as TABS se o usuário não for administrador*/
- function remove_medialibrary_tab($tabs) {
- if ( !current_user_can('administrator') ) {
- unset($tabs["type_url"]);
- unset($tabs['library']);
- unset($tabs['nextgen']); //Se o plugin NextGen Gallery estiver ativado!
- return $tabs;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement