From 3462e6af43953a0e221d2a4350b7eaffa4e78b92 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Mon, 1 Nov 2010 18:05:33 +0000 Subject: [PATCH] Add a post class if a password is required for the post to be displayed. See #13860 props zeo. git-svn-id: https://develop.svn.wordpress.org/trunk@16138 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-template.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 30c5653b08..256dd1cc45 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -327,11 +327,15 @@ function get_post_class( $class = '', $post_id = null ) { $classes[] = $post->post_type; $classes[] = 'type-' . $post->post_type; + // post requires password + if ( post_password_required($post->ID) ) + $classes[] = 'post-password-required'; + // sticky for Sticky Posts if ( is_sticky($post->ID) && is_home() && !is_paged() ) $classes[] = 'sticky'; - // hentry for hAtom compliace + // hentry for hAtom compliance $classes[] = 'hentry'; // Categories