Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to remove some of the media upload buttons just above TinyMCE in the Add post screen, how can I do that? Thanks.

share|improve this question

3 Answers 3

If you want to get rid all all media buttons, you can remove the media_buttons action:

add_action('admin_init', 'remove_all_media_buttons');

function remove_all_media_buttons()
{
    remove_all_actions('media_buttons');
}

Since you only want to remove some buttons, I suggest adding an admin stylesheet:

add_action('admin_init', 'my_admin_stylesheet');

function my_admin_stylesheet()
{
    wp_enqueue_style('my_admin', get_bloginfo('template_url').'/css/my_admin.css');
}

In the my_admin.css you can hide the buttons:

/* Hide the buttons you want */
#add_image { display:none; }
#add_video { display:none; }
#add_audio { display:none; }
#add_media { display:none; }
share|improve this answer
1  
just for the record, you can fine tune the script loading this way global $current_screen; switch ($current_screen->id) { case 'page': case 'post': wp_enqueue_style('my_admin', get_bloginfo('template_url').'/css/my_admin.css'); break; } –  brasofilo Mar 29 '12 at 1:12
    
is there any new solution for current version (3.5) of wordpress? –  Sisir Mar 4 '13 at 18:07

Or simply upgrade to WordPress 3.3 that got rid of that.

share|improve this answer

In case someone wants to remove the media button on latest version of wordpress. Below is example for removing it for only posts. You can remove the if statement to make it disappear for all post types. Or add a CPT name if you want it remove on a CPT.

add_action( 'admin_head' , 'product_remove_editor_upload' );
function product_remove_editor_upload(){
    global $post;
    if(isset($post) && $post->post_type ==  'post'){
        remove_action( 'media_buttons', 'media_buttons' );
    }
}

Tested in 3.5.1

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.