Changeset 56811
- Timestamp:
- 10/09/2023 11:01:15 PM (11 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-query.php
r56763 r56811 3192 3192 return $this->posts; 3193 3193 } elseif ( 'id=>parent' === $q['fields'] ) { 3194 _prime_post_parent s_caches( $post_ids );3194 _prime_post_parent_id_caches( $post_ids ); 3195 3195 3196 3196 /** @var int[] */ -
trunk/src/wp-includes/post.php
r56773 r56811 7798 7798 7799 7799 /** 7800 * Prime post parent caches.7800 * Prime the cache containing the parent ID of various post objects. 7801 7801 * 7802 7802 * @global wpdb $wpdb WordPress database abstraction object. … … 7806 7806 * @param int[] $ids ID list. 7807 7807 */ 7808 function _prime_post_parent s_caches( array $ids ) {7808 function _prime_post_parent_id_caches( array $ids ) { 7809 7809 global $wpdb; 7810 7810 -
trunk/tests/phpunit/tests/post/primePostParentsCaches.php
r56766 r56811 1 1 <?php 2 2 /** 3 * Test `_prime_post_parent s_caches()`.3 * Test `_prime_post_parent_id_caches()`. 4 4 * 5 5 * @package WordPress … … 7 7 8 8 /** 9 * Test class for `_prime_post_parent s_caches()`.9 * Test class for `_prime_post_parent_id_caches()`. 10 10 * 11 11 * @group post 12 12 * @group cache 13 13 * 14 * @covers ::_prime_post_parent s_caches14 * @covers ::_prime_post_parent_id_caches 15 15 */ 16 class Tests_Post_PrimePostParent sCaches extends WP_UnitTestCase {16 class Tests_Post_PrimePostParentIdCaches extends WP_UnitTestCase { 17 17 18 18 /** … … 35 35 * @ticket 59188 36 36 */ 37 public function test_prime_post_parent s_caches() {37 public function test_prime_post_parent_id_caches() { 38 38 $post_id = self::$posts[0]; 39 39 40 40 $before_num_queries = get_num_queries(); 41 _prime_post_parent s_caches( array( $post_id ) );41 _prime_post_parent_id_caches( array( $post_id ) ); 42 42 $num_queries = get_num_queries() - $before_num_queries; 43 43 … … 49 49 * @ticket 59188 50 50 */ 51 public function test_prime_post_parent s_caches_multiple() {51 public function test_prime_post_parent_id_caches_multiple() { 52 52 $before_num_queries = get_num_queries(); 53 _prime_post_parent s_caches( self::$posts );53 _prime_post_parent_id_caches( self::$posts ); 54 54 $num_queries = get_num_queries() - $before_num_queries; 55 55 … … 61 61 * @ticket 59188 62 62 */ 63 public function test_prime_post_parent s_caches_multiple_runs() {64 _prime_post_parent s_caches( self::$posts );63 public function test_prime_post_parent_id_caches_multiple_runs() { 64 _prime_post_parent_id_caches( self::$posts ); 65 65 $before_num_queries = get_num_queries(); 66 _prime_post_parent s_caches( self::$posts );66 _prime_post_parent_id_caches( self::$posts ); 67 67 $num_queries = get_num_queries() - $before_num_queries; 68 68 … … 73 73 * @ticket 59188 74 74 */ 75 public function test_prime_post_parent s_caches_update() {75 public function test_prime_post_parent_id_caches_update() { 76 76 $page_id = self::factory()->post->create( 77 77 array( … … 81 81 ); 82 82 $before_num_queries = get_num_queries(); 83 _prime_post_parent s_caches( array( $page_id ) );83 _prime_post_parent_id_caches( array( $page_id ) ); 84 84 $num_queries = get_num_queries() - $before_num_queries; 85 85 … … 95 95 96 96 $before_num_queries = get_num_queries(); 97 _prime_post_parent s_caches( array( $page_id ) );97 _prime_post_parent_id_caches( array( $page_id ) ); 98 98 $num_queries = get_num_queries() - $before_num_queries; 99 99 … … 105 105 * @ticket 59188 106 106 */ 107 public function test_prime_post_parent s_caches_delete() {107 public function test_prime_post_parent_id_caches_delete() { 108 108 $parent_page_id = self::factory()->post->create( 109 109 array( … … 118 118 ); 119 119 $before_num_queries = get_num_queries(); 120 _prime_post_parent s_caches( array( $page_id ) );120 _prime_post_parent_id_caches( array( $page_id ) ); 121 121 $num_queries = get_num_queries() - $before_num_queries; 122 122
Note: See TracChangeset
for help on using the changeset viewer.