Changeset 53507
- Timestamp:
- 06/15/2022 01:17:59 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r53506 r53507 7491 7491 7492 7492 /** 7493 * Prime post parent post caches.7493 * Updates parent post caches for a list of post objects. 7494 7494 * 7495 7495 * @since 6.1.0 7496 7496 * 7497 * @param WP_Post[] $posts Array of Post objects.7497 * @param WP_Post[] $posts Array of post objects. 7498 7498 */ 7499 7499 function update_post_parent_caches( $posts ) { … … 7501 7501 $parent_ids = array_map( 'absint', $parent_ids ); 7502 7502 $parent_ids = array_unique( array_filter( $parent_ids ) ); 7503 7503 7504 if ( ! empty( $parent_ids ) ) { 7504 7505 _prime_post_caches( $parent_ids, false ); -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r53506 r53507 370 370 $posts = array(); 371 371 372 update_post_author_caches( $query_result ); 372 373 update_post_parent_caches( $query_result ); 373 update_post_author_caches( $query_result ); 374 374 375 if ( post_type_supports( $this->post_type, 'thumbnail' ) ) { 375 376 update_post_thumbnail_cache( $posts_query ); -
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r53506 r53507 1517 1517 /** 1518 1518 * @ticket 55592 1519 * @covers WP_REST_Posts_Controller::get_items ()1519 * @covers WP_REST_Posts_Controller::get_items 1520 1520 */ 1521 1521 public function test_get_items_with_featured_media() { … … 1790 1790 /** 1791 1791 * @ticket 55593 1792 * @covers WP_REST_Posts_Controller::get_items 1793 * @covers update_post_parent_caches 1792 1794 */ 1793 1795 public function test_get_items_parent_ids_primed() {
Note: See TracChangeset
for help on using the changeset viewer.