For our customization want to check post type and remove media buttons in wp-admin then place the following snippet in functions.php within your theme folder!. add your custom post type slug instead of custom-post-type.

add_action('admin_head', 'check_post_type_and_remove_media_buttons');
function check_post_type_and_remove_media_buttons()
{
	global $post;
	if($post->post_type == 'custom-post-type')
	{
		remove_action( 'media_buttons', 'media_buttons' );
	}
}

Have any doubt, then comment here!

Leave a Reply

Your email address will not be published. Required fields are marked *