From 26597c2e3442985072a18e258ba2c9cb3f4e4765 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 3 Jan 2011 23:56:42 +0000 Subject: [PATCH] Ignore unsupported post types in add_theme_support(). Props garyc40. fixes #16073 git-svn-id: https://develop.svn.wordpress.org/trunk@17213 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 9d2f905af6..46c1cf1740 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1754,6 +1754,9 @@ function add_theme_support( $feature ) { $_wp_theme_features[$feature] = true; else $_wp_theme_features[$feature] = array_slice( func_get_args(), 1 ); + + if ( $feature == 'post-formats' && is_array( $_wp_theme_features[$feature][0] ) ) + $_wp_theme_features[$feature][0] = array_intersect( $_wp_theme_features[$feature][0], array_keys( get_post_format_slugs() ) ); } /**