From 6e2ffdc2890e7adadef9830dea4417afee6c957b Mon Sep 17 00:00:00 2001 From: duck_ Date: Mon, 19 Sep 2011 16:29:03 +0000 Subject: [PATCH] Allow current_theme_supports() to be used to check for specific post formats. Props ericmann. Fixes #18691. git-svn-id: http://svn.automattic.com/wordpress/trunk@18720 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 1b9a36c94..0f30385f9 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1947,10 +1947,14 @@ function current_theme_supports( $feature ) { if ( true === $_wp_theme_features[$feature] ) // Registered for all types return true; $content_type = $args[0]; - if ( in_array($content_type, $_wp_theme_features[$feature][0]) ) - return true; - else - return false; + return in_array( $content_type, $_wp_theme_features[$feature][0] ); + break; + + case 'post-formats': + // specific post formats can be registered by passing an array of types to + // add_theme_support() + $post_format = $args[0]; + return in_array( $post_format, $_wp_theme_features[$feature][0] ); break; }