Make WordPress Core

Changeset 17292


Ignore:
Timestamp:
01/13/2011 11:02:24 PM (14 years ago)
Author:
nacin
Message:

Only add the post format post classes when the post type supports post formats. posts posts posts posts. props iandstewart, fixes #16224.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r16834 r17292  
    332332    $post_format = get_post_format( $post->ID );
    333333
    334     if ( $post_format && !is_wp_error($post_format) )
    335         $classes[] = 'format-' . sanitize_html_class( $post_format );
    336     else
    337         $classes[] = 'format-standard';
     334    if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
     335        if ( $post_format && !is_wp_error($post_format) )
     336            $classes[] = 'format-' . sanitize_html_class( $post_format );
     337        else
     338            $classes[] = 'format-standard';
     339    }
    338340
    339341    // post requires password
Note: See TracChangeset for help on using the changeset viewer.