From d8ddd686d56f2a27f83a74d65db711a6d721ab00 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 26 Oct 2015 15:08:47 +0000 Subject: [PATCH] In `get_post_class()`, ensure that we always coerce the class list passed to the function to an array, even when it's empty. This is consistent with `get_body_class()`, see [18176]. See #34452. git-svn-id: https://develop.svn.wordpress.org/trunk@35399 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-template.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index 5c1f2f284c..b3fd95c7c1 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -429,6 +429,9 @@ function get_post_class( $class = '', $post_id = null ) { $class = preg_split( '#\s+#', $class ); } $classes = array_map( 'esc_attr', $class ); + } else { + // Ensure that we always coerce class to being an array. + $class = array(); } if ( ! $post ) {