mirror of
https://github.com/WordPress/WordPress.git
synced 2025-12-05 11:24:25 +01:00
Posts, Post Types: Ensure get_post_class() returns a list.
This avoids the REST API erroneously returning an object in the `class_list` property returned by `WP_REST_Posts_Controller::prepare_item_for_response()`. Developed in https://github.com/WordPress/wordpress-develop/pull/10515 Props dlh, mamaduka, westonruter. Fixes #64247. Built from https://develop.svn.wordpress.org/trunk@61269 git-svn-id: http://core.svn.wordpress.org/trunk@60581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e8d1cb9adc
commit
32de466672
@ -606,7 +606,10 @@ function get_post_class( $css_class = '', $post = null ) {
|
||||
*/
|
||||
$classes = apply_filters( 'post_class', $classes, $css_class, $post->ID );
|
||||
|
||||
return array_unique( $classes );
|
||||
$classes = array_unique( $classes );
|
||||
$classes = array_values( $classes );
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '7.0-alpha-61268';
|
||||
$wp_version = '7.0-alpha-61269';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user