I recently released my first plugin, Meteor Slides, which adds a custom post type for slides.
The slide images are managed using the Featured Image functionality. To ensure that this works with older themes, my plugin is adding support for post thumbnails like this:
This has worked well so far to add thumbnail support for the slides post type, without adding it to posts and pages in themes that don't support this feature.PHP Code:add_theme_support( 'post-thumbnails', array( 'slide' ) );
The above code works with themes that have no thumbnail support, and it works with themes that have it fully enabled like this:
But I just found out that when a theme enables this feature for a specific post type or types using an array, the featured image feature is disabled in my plugin.PHP Code:add_theme_support( 'post-thumbnails' );
Here is an example of how one theme that conflicts with my plugin adds post thumbnail support:
It doesn't matter if the theme is specifying support for posts, pages, or another custom post type; if an array is used like this there is a conflict.PHP Code:add_theme_support( 'post-thumbnails', array( 'post' ) );
I had thought that the two arrays were the source of the conflict, but even when I remove the array from my plugin and enable post thumbnails for all post types, the conflict remains unchanged.
So I am assuming that when a theme specifies certain post types to be enabled with this feature, it overrides that setting in plugins?
Does anyone know anything more about adding post-thumbnails that could help me with this problem?
My only idea right now would be to check if the theme or another plugin has added support for this already, and if it has added an array, filter that array to include my custom post type. Would something like this even be possible?


LinkBack URL
About LinkBacks
Reply With Quote

