rebase on oct-10-2023
This commit is contained in:
@@ -228,6 +228,7 @@ class WP_Network {
|
||||
* @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 );
|
||||
|
||||
if ( 0 < $main_site_id ) {
|
||||
return $main_site_id;
|
||||
}
|
||||
@@ -236,8 +237,10 @@ class WP_Network {
|
||||
return (int) $this->blog_id;
|
||||
}
|
||||
|
||||
if ( ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) && DOMAIN_CURRENT_SITE === $this->domain && PATH_CURRENT_SITE === $this->path )
|
||||
|| ( defined( 'SITE_ID_CURRENT_SITE' ) && SITE_ID_CURRENT_SITE == $this->id ) ) {
|
||||
if ( ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' )
|
||||
&& DOMAIN_CURRENT_SITE === $this->domain && PATH_CURRENT_SITE === $this->path )
|
||||
|| ( defined( 'SITE_ID_CURRENT_SITE' ) && (int) SITE_ID_CURRENT_SITE === $this->id )
|
||||
) {
|
||||
if ( defined( 'BLOG_ID_CURRENT_SITE' ) ) {
|
||||
$this->blog_id = (string) BLOG_ID_CURRENT_SITE;
|
||||
|
||||
@@ -306,7 +309,7 @@ class WP_Network {
|
||||
}
|
||||
|
||||
$this->cookie_domain = $this->domain;
|
||||
if ( 'www.' === substr( $this->cookie_domain, 0, 4 ) ) {
|
||||
if ( str_starts_with( $this->cookie_domain, 'www.' ) ) {
|
||||
$this->cookie_domain = substr( $this->cookie_domain, 4 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user