Changeset 53098
- Timestamp:
- 04/07/2022 05:57:59 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-network-query.php
r52977 r53098 243 243 $_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ); 244 244 245 // Ignore the $fields argumentas the queried result will be the same regardless.246 unset( $_args['fields'] );245 // Ignore the $fields, $update_network_cache arguments as the queried result will be the same regardless. 246 unset( $_args['fields'], $_args['update_network_cache'] ); 247 247 248 248 $key = md5( serialize( $_args ) ); -
trunk/tests/phpunit/tests/multisite/wpNetworkQuery.php
r51869 r53098 511 511 512 512 /** 513 * @ticket 55461 514 */ 515 public function test_wp_network_query_cache_with_same_fields_same_cache_field() { 516 $q = new WP_Network_Query(); 517 $query_1 = $q->query( 518 array( 519 'fields' => 'all', 520 'number' => 3, 521 'order' => 'ASC', 522 'update_network_cache' => true, 523 ) 524 ); 525 $number_of_queries = get_num_queries(); 526 527 $query_2 = $q->query( 528 array( 529 'fields' => 'all', 530 'number' => 3, 531 'order' => 'ASC', 532 'update_network_cache' => true, 533 ) 534 ); 535 536 $this->assertSame( $number_of_queries, get_num_queries() ); 537 } 538 539 /** 540 * @ticket 55461 541 */ 542 public function test_wp_network_query_cache_with_same_fields_different_cache_field() { 543 $q = new WP_Network_Query(); 544 $query_1 = $q->query( 545 array( 546 'fields' => 'all', 547 'number' => 3, 548 'order' => 'ASC', 549 'update_network_cache' => true, 550 ) 551 ); 552 $number_of_queries = get_num_queries(); 553 554 $query_2 = $q->query( 555 array( 556 'fields' => 'all', 557 'number' => 3, 558 'order' => 'ASC', 559 'update_network_cache' => false, 560 ) 561 ); 562 563 $this->assertSame( $number_of_queries, get_num_queries() ); 564 } 565 566 /** 513 567 * @ticket 45749 514 568 * @ticket 47599
Note: See TracChangeset
for help on using the changeset viewer.