Make WordPress Core

Ticket #18804: 18804.patch

File 18804.patch, 1.3 KB (added by anonymized_8769252, 12 years ago)
  • wp-includes/post-template.php

     
    304304/**
    305305 * Retrieve the classes for the post div as an array.
    306306 *
    307  * The class names are add are many. If the post is a sticky, then the 'sticky'
    308  * class name. The class 'hentry' is always added to each post. For each
     307 * The class names are many. If the post is a sticky, then the 'sticky'
     308 * class name. The class 'hentry' is always added to each post. If the post has a
     309 * post thumbnail, 'post-thumbnail' is added as a class. For each
    309310 * category, the class will be added with 'category-' with category slug is
    310311 * added. The tags are the same way as the categories with 'tag-' before the tag
    311312 * slug. All classes are passed through the filter, 'post_class' with the list
     
    341342                else
    342343                        $classes[] = 'format-standard';
    343344        }
     345       
     346        // Post Thumbnail, but we need to check for theme support before we call the function
     347        if ( current_theme_supports( 'post-thumbnails' ) ) {
     348                if ( ! post_password_required( $post->ID ) && has_post_thumbnail( $post->ID ) ) {
     349                        $classes[] = 'post-thumbnail';
     350                }
     351        }
    344352
    345353        // post requires password
    346354        if ( post_password_required($post->ID) )