Last Updated: February 25, 2016
·
860
· fabax

Remove feature image from custom post type wordpress

function remove_image_box() {
     if ($current_user->user_level < 10){
       remove_meta_box('postimagediv','your_custom_post_type','side');
     }
}
add_action('do_meta_boxes', 'remove_image_box');

1 Response
Add your response

When registering a custom post type, you should set the 'supports' argument. If you don't want featured images, make sure the supports array doesn't contain 'thumbnail'

See this codex page, http://codex.wordpress.org/Function_Reference/register_post_type, and look for the supports argument (it'll explain it better than I can!)

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Related Tags
#php
#wordpress
Did you know?

WordPress sites collect scripts from themes, plugins, and tag managers. A compromised plugin update can add a skimmer to every page without a change in your own templates.

Security insights from Cside