mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 18:13:00 +01:00
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: https://develop.svn.wordpress.org/trunk@17292 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
af64a47f5d
commit
dc864d94e8
@ -331,10 +331,12 @@ function get_post_class( $class = '', $post_id = null ) {
|
|||||||
// Post Format
|
// Post Format
|
||||||
$post_format = get_post_format( $post->ID );
|
$post_format = get_post_format( $post->ID );
|
||||||
|
|
||||||
if ( $post_format && !is_wp_error($post_format) )
|
if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
|
||||||
$classes[] = 'format-' . sanitize_html_class( $post_format );
|
if ( $post_format && !is_wp_error($post_format) )
|
||||||
else
|
$classes[] = 'format-' . sanitize_html_class( $post_format );
|
||||||
$classes[] = 'format-standard';
|
else
|
||||||
|
$classes[] = 'format-standard';
|
||||||
|
}
|
||||||
|
|
||||||
// post requires password
|
// post requires password
|
||||||
if ( post_password_required($post->ID) )
|
if ( post_password_required($post->ID) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user