WordPress.org

Support

Support » Plugins and Hacks » Drag & Drop Featured Image » [Resolved] [Plugin: Drag & Drop Featured Image] Featured Image Won't Disappear When Function is Set to

[Resolved] [Plugin: Drag & Drop Featured Image] Featured Image Won't Disappear When Function is Set to

  • In my functions.php file, I have added theme support for post thumbnails:

    if(function_exists('add_theme_support')) {
    	add_theme_support( 'post-thumbnails' );
    }

    I have added another function to remove the Featured Image box from specified post types (e.g. Page, Post, or a Custom Post Type).

    function remove_image_box() {
    	remove_meta_box( 'postimagediv','page','side' );
    	remove_meta_box( 'postimagediv','news','side' ); // custom post type
    }
    add_action('do_meta_boxes', 'remove_image_box');

    This works well when the D&D plugin is NOT enabled, but once it is enabled, the D&D Featured Image box appears with all post types, regardless of the removal function.

    Is there a way to fix this, or a better function I could use to remove the Featured Image box for specific post types?

    http://wordpress.org/extend/plugins/drag-drop-featured-image/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello Adam!

    My plugin automatically adds post thumbnail support for activated post types and removes the default meta box replacing it with the one from my plugin. Therefore you should not have to worry about enabling the theme support yourself.

    If this is an issue let me know, and I’ll try to create a solution.

    Best regards,
    Jonathan

    My plugin automatically adds post thumbnail support for activated post types and removes the default meta box replacing it with the one from my plugin.

    Does this mean that instead of disabling the WP meta boxes, I should be targeting the meta box from your plugin? If so, how do I go about doing this? Thanks!

    Hello again!

    This is how the plugin works:
    It activates theme support for post thumbnails and loops through the post types that you have enabled. Then it adds post type support for a featured image for all of those post types and removes the default “Featured Image” meta box.

    So, if you have a post type where you have not applied my plugin to, you should be able to remove the box in the normal manner by using this code:

    remove_post_type_support('POST_TYPE', 'thumbnail');
    remove_meta_box('postimagediv', 'POST_TYPE', 'side');
    remove_meta_box('postimagediv', 'POST_TYPE', 'normal');
    remove_meta_box('postimagediv', 'POST_TYPE', 'advanced');

    Let me know if you still experience problems and I will try my best to fix this.

    Plugin Author Jonathan Lundström

    @plizzo

    Since nothing more has happened in this thread I’m taking the liberty of marking this issue as resolved. Please do notify me if you have any additional problems.

    Adam

    @panhead

    Thanks, Jonathan. Everything’s working fine!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] [Plugin: Drag & Drop Featured Image] Featured Image Won't Disappear When Function is Set to’ is closed to new replies.
Skip to toolbar