• Fantastic plugin! I am trying to leverage it as a part of a custom post type (to store for display a series of rotating banners) and have run into a couple of questions that I need clarification on. Most relate to the fact that previous code examples are for themes vs plugins I think.

    Where to run MultiPostThumbnails definition for plugin?
    If I add the following to my theme functions.php file it works properly:

    $thumbEN = new MultiPostThumbnails(array(
         'label' => 'English Banner (740x200)',
         'id' => 'english-banner',
         'post_type' => 'banners'
    ));

    However when I add that as a part of my plugin init call that is attached to the init action – where I run register_post_type, add_image_size – it causes the odd behaviour of none of my media library images to be visible to select to use as featured image. I can see the count of # of images in the library, but none of the table below it.

    How to remove the default featured image selector?
    If I create the post type with ‘thumbnail’ as a part of the supports array, everything works fine. If I create it without, when I click on the set link (“Set English Banner (740×200)” from example above), the media selector does not load as a pop-up but as a new page that no longer can return the result to the admin window. The same is true if I try to use a remove_meta_box on the default featured image meta box – postimagediv.

    Can you add context to the paramaters for MultiPostThumbnails?
    This calls your add_meta_box function which has the context hard-coded as ‘side’. You’ve exposed priority as a parameter already, is there any reason that context could not be?

The topic ‘[Plugin: Multiple Post Thumbnails] Custom Post Type / Plugin / Code Questions’ is closed to new replies.