• Is there a hook to remove the media upload link on custom post type, without removing the editor?

    Tried using remove_post_type_support, but no handle on media upload only.

Viewing 1 replies (of 1 total)
  • You can try this…

    add_action('admin_head', 'my_remove_mediabuttons');
    	function my_remove_mediabuttons()
    	{
    		global $post;
    		if($post->post_type == 'my_post_type_name' && !current_user_can('publish_posts') )
    		{
    		remove_action( 'media_buttons', 'media_buttons' );
    		}
    	}

    In this case just for users who cannot publish posts and for post type name ‘my_post_type_name’. Just replace ‘my_post_type_name’ with you custom post type.

Viewing 1 replies (of 1 total)
  • The topic ‘how to remove upload on custom post type?’ is closed to new replies.