Make WordPress Core

Changeset 27429


Ignore:
Timestamp:
03/06/2014 06:05:58 AM (10 years ago)
Author:
nacin
Message:

Add has-post-thumbnail as a post class.

props danielbachhuber, frank-klein.
fixes #18804.

File:
1 edited

Legend:

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

    r27360 r27429  
    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, 'has-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
     
    343344    }
    344345
    345     // post requires password
    346     if ( post_password_required($post->ID) )
     346    // Post requires password
     347    if ( post_password_required( $post->ID ) ) {
    347348        $classes[] = 'post-password-required';
     349    // Post thumbnails
     350    } elseif ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) ) {
     351        $classes[] = 'has-post-thumbnail';
     352    }
    348353
    349354    // sticky for Sticky Posts
Note: See TracChangeset for help on using the changeset viewer.