From ce0ebf0c953995d0c66f3973507f2c143b74c0b8 Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 13 Jan 2011 23:02:24 +0000 Subject: [PATCH] Only add the post format post classes when the post type supports post formats. posts posts posts posts. props iandstewart, fixes #16224. git-svn-id: http://svn.automattic.com/wordpress/trunk@17292 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index c3bfa2bb49..bf4671b6fe 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -331,10 +331,12 @@ function get_post_class( $class = '', $post_id = null ) { // Post Format $post_format = get_post_format( $post->ID ); - if ( $post_format && !is_wp_error($post_format) ) - $classes[] = 'format-' . sanitize_html_class( $post_format ); - else - $classes[] = 'format-standard'; + if ( post_type_supports( $post->post_type, 'post-formats' ) ) { + if ( $post_format && !is_wp_error($post_format) ) + $classes[] = 'format-' . sanitize_html_class( $post_format ); + else + $classes[] = 'format-standard'; + } // post requires password if ( post_password_required($post->ID) )