[wp-trac] [WordPress Trac] #18790: add_theme_support with post type doesn't add theme support but overwrites it
WordPress Trac
wp-trac at lists.automattic.com
Tue Sep 27 12:17:13 UTC 2011
#18790: add_theme_support with post type doesn't add theme support but overwrites
it
--------------------------+-----------------------------
Reporter: Jesper800 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 3.2.1
Severity: normal | Keywords:
--------------------------+-----------------------------
The function add_theme_support has an optional second parameter, which
allows you to add support for post thumbnails for certain post types.
You would expect this function to add the theme support for that post
type, but instead it overwrites the theme support for that feature, which
results in the theme support being set for just the post type(s) that were
passed.
Reproduce:
{{{
function add_thumbnails_support()
{
add_theme_support('post-thumbnails', array('my_post_type'));
print_r(get_theme_support('post-thumbnails'));
add_theme_support('post-thumbnails', array('another_post_type'));
print_r(get_theme_support('post-thumbnails'));
}
add_action('after_setup_theme', 'add_thumbnails_support');
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18790>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list