WordPress build repository browser

Changeset 60581


Ignore:
Timestamp:
11/19/2025 06:03:30 AM (6 days ago)
Author:
westonruter
Message:

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

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r59558 r60581  
    607607    $classes = apply_filters( 'post_class', $classes, $css_class, $post->ID );
    608608
    609     return array_unique( $classes );
     609    $classes = array_unique( $classes );
     610    $classes = array_values( $classes );
     611
     612    return $classes;
    610613}
    611614
  • trunk/wp-includes/version.php

    r60580 r60581  
    1717 * @global string $wp_version
    1818 */
    19 $wp_version = '7.0-alpha-61268';
     19$wp_version = '7.0-alpha-61269';
    2020
    2121/**
Note: See TracChangeset for help on using the changeset viewer.