Make WordPress Core

Ticket #21899: 21899.3.diff

File 21899.3.diff, 985 bytes (added by obenland, 9 years ago)
  • src/wp-includes/post-template.php

     
    450450                        $classes[] = 'format-standard';
    451451        }
    452452
    453         // Post requires password
    454         if ( post_password_required( $post->ID ) ) {
     453        $post_password_required = post_password_required( $post->ID );
     454
     455        // Post requires password.
     456        if ( $post_password_required ) {
    455457                $classes[] = 'post-password-required';
    456         // Post thumbnails
    457         } elseif ( ! is_attachment( $post ) && current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) ) {
     458        } elseif ( ! empty( $post->post_password ) ) {
     459                $classes[] = 'post-password-protected';
     460        }
     461
     462        // Post thumbnails.
     463        if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) && ! is_attachment( $post ) && ! $post_password_required ) {
    458464                $classes[] = 'has-post-thumbnail';
    459465        }
    460466