mirror of
git://develop.git.wordpress.org/
synced 2025-02-24 16:43:06 +01:00
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
This commit is contained in:
parent
8a105470b4
commit
d8ddd686d5
@ -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 ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user