Changeset 40486
- Timestamp:
- 04/20/2017 12:26:30 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r40485 r40486 2275 2275 * 2276 2276 * @since 3.1.0 2277 */ 2278 function wp_update_network_counts() { 2279 wp_update_network_user_counts(); 2280 wp_update_network_site_counts(); 2277 * @since 4.8.0 The $network_id parameter has been added. 2278 * 2279 * @param int|null $network_id ID of the network. Default is the current network. 2280 */ 2281 function wp_update_network_counts( $network_id = null ) { 2282 wp_update_network_user_counts( $network_id ); 2283 wp_update_network_site_counts( $network_id ); 2281 2284 } 2282 2285 -
trunk/tests/phpunit/tests/multisite/network.php
r40485 r40486 441 441 $this->assertEquals( $expected, $result ); 442 442 } 443 444 /** 445 * @ticket 40386 446 */ 447 public function test_wp_update_network_counts() { 448 delete_network_option( null, 'site_count' ); 449 delete_network_option( null, 'user_count' ); 450 451 wp_update_network_counts(); 452 453 $site_count = (int) get_blog_count(); 454 $user_count = (int) get_user_count(); 455 456 $this->assertTrue( $site_count > 0 && $user_count > 0 ); 457 } 458 459 /** 460 * @ticket 40386 461 */ 462 public function test_wp_update_network_counts_on_different_network() { 463 delete_network_option( self::$different_network_id, 'site_count' ); 464 delete_network_option( self::$different_network_id, 'user_count' ); 465 466 wp_update_network_counts( self::$different_network_id ); 467 468 $site_count = (int) get_blog_count( self::$different_network_id ); 469 $user_count = (int) get_user_count( self::$different_network_id ); 470 471 $this->assertTrue( $site_count > 0 && $user_count > 0 ); 472 } 443 473 } 444 474
Note: See TracChangeset
for help on using the changeset viewer.