[wp-trac] [WordPress Trac] #22080: add_theme_support should merge post-thumbnail post types by default (currently stomps)
WordPress Trac
wp-trac at lists.automattic.com
Tue Oct 2 23:43:01 UTC 2012
#22080: add_theme_support should merge post-thumbnail post types by default
(currently stomps)
-----------------------------------+------------------------------
Reporter: alexkingorg | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Post Thumbnails | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion |
-----------------------------------+------------------------------
Comment (by alexkingorg):
add_theme_support is an API, the usage example in the codex is:
{{{
add_theme_support( 'post-thumbnails' );
add_theme_support( 'post-thumbnails', array( 'post' ) ); // Posts
only
add_theme_support( 'post-thumbnails', array( 'page' ) ); // Pages
only
add_theme_support( 'post-thumbnails', array( 'post', 'movie' ) ); // Posts
and Movies
}}}
I mistakenly understood this to mean I could add support for other post
types by passing them in. I believe others will make the same mistake. The
code in the Gist that "fixes" this is simple but was decidedly non-trivial
to discover. Requiring that type of interaction with an API makes it
likely for people to make mistakes. I think making it easier for them is
better.
The action this API currently takes for post-thumbnails would be better
named as `set_theme_support()` rather than `add_theme_support()`.
I also agree that remove_theme_support should accept a post type param for
post-thumbnails, but didn't have time to add that to the patch yet.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22080#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list