From deb852ca3e3d35329d9348c249dcbd42ac71a399 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Wed, 19 Mar 2014 20:48:28 +0000 Subject: [PATCH] Twenty Fourteen: revert r27623 `post_class` filter removal since it will visually break pre-WP 3.9 installs. See #18804. git-svn-id: https://develop.svn.wordpress.org/trunk@27624 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentyfourteen/functions.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/wp-content/themes/twentyfourteen/functions.php b/src/wp-content/themes/twentyfourteen/functions.php index 10125d8dba..c81df1ff3d 100644 --- a/src/wp-content/themes/twentyfourteen/functions.php +++ b/src/wp-content/themes/twentyfourteen/functions.php @@ -437,6 +437,26 @@ function twentyfourteen_body_classes( $classes ) { } add_filter( 'body_class', 'twentyfourteen_body_classes' ); +/** + * Extend the default WordPress post classes. + * + * Adds a post class to denote: + * Non-password protected page with a post thumbnail. + * + * @since Twenty Fourteen 1.0 + * + * @param array $classes A list of existing post class values. + * @return array The filtered post class list. + */ +function twentyfourteen_post_classes( $classes ) { + if ( ! post_password_required() && ! is_attachment() && has_post_thumbnail() ) { + $classes[] = 'has-post-thumbnail'; + } + + return $classes; +} +add_filter( 'post_class', 'twentyfourteen_post_classes' ); + /** * Create a nicely formatted and more specific title element text for output * in head of document, based on current view.