Multisite: Pass network object instead of ID to `pre_get_main_site_id`.
In the original function introduced in [41380], and subsequently [41861], only the network ID was passed to the new `pre_get_main_site_id` filter. In order to make give quick access to other network properties, it was decided to pass the whole object instead. The changeset includes an additional test. Fixes #29684. Built from https://develop.svn.wordpress.org/trunk@42043 git-svn-id: http://core.svn.wordpress.org/trunk@41877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ca84147401
commit
82c6a301f2
|
@ -219,10 +219,10 @@ class WP_Network {
|
|||
*
|
||||
* @since 4.9.0
|
||||
*
|
||||
* @param int|null $main_site_id If a positive integer is returned, it is interpreted as the main site ID.
|
||||
* @param int $network_id The ID of the network for which the main site was detected.
|
||||
* @param int|null $main_site_id If a positive integer is returned, it is interpreted as the main site ID.
|
||||
* @param WP_Network $network The network object for which the main site was detected.
|
||||
*/
|
||||
$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this->id );
|
||||
$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this );
|
||||
if ( 0 < $main_site_id ) {
|
||||
return $main_site_id;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.9-beta4-42042';
|
||||
$wp_version = '4.9-beta4-42043';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue