Update WP and plugins

This commit is contained in:
Oliver Davies 2019-04-16 20:56:22 +01:00
parent 10a4713229
commit 1fb77fc4ff
864 changed files with 101724 additions and 78262 deletions

View file

@ -125,7 +125,7 @@ class WP_Network {
* @param WP_Network|object $network A network object.
*/
public function __construct( $network ) {
foreach( get_object_vars( $network ) as $key => $value ) {
foreach ( get_object_vars( $network ) as $key => $value ) {
$this->$key = $value;
}
@ -254,13 +254,15 @@ class WP_Network {
$main_site_id = wp_cache_get( $cache_key, 'site-options' );
if ( false === $main_site_id ) {
$_sites = get_sites( array(
'fields' => 'ids',
'number' => 1,
'domain' => $this->domain,
'path' => $this->path,
'network_id' => $this->id,
) );
$_sites = get_sites(
array(
'fields' => 'ids',
'number' => 1,
'domain' => $this->domain,
'path' => $this->path,
'network_id' => $this->id,
)
);
$main_site_id = ! empty( $_sites ) ? array_shift( $_sites ) : 0;
wp_cache_add( $cache_key, $main_site_id, 'site-options' );
@ -282,7 +284,7 @@ class WP_Network {
return;
}
$default = ucfirst( $this->domain );
$default = ucfirst( $this->domain );
$this->site_name = get_network_option( $this->id, 'site_name', $default );
}
@ -316,7 +318,6 @@ class WP_Network {
* requested site address.
*
* @since 4.4.0
* @static
*
* @param string $domain Domain to check.
* @param string $path Path to check.
@ -350,12 +351,14 @@ class WP_Network {
if ( wp_using_ext_object_cache() ) {
$using_paths = wp_cache_get( 'networks_have_paths', 'site-options' );
if ( false === $using_paths ) {
$using_paths = get_networks( array(
'number' => 1,
'count' => true,
'path__not_in' => '/',
) );
wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' );
$using_paths = get_networks(
array(
'number' => 1,
'count' => true,
'path__not_in' => '/',
)
);
wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' );
}
}
@ -400,12 +403,12 @@ class WP_Network {
*
* @since 3.9.0
*
* @param null|bool|object $network Network value to return by path.
* @param string $domain The requested domain.
* @param string $path The requested path, in full.
* @param int|null $segments The suggested number of paths to consult.
* Default null, meaning the entire path was to be consulted.
* @param array $paths The paths to search for, based on $path and $segments.
* @param null|bool|WP_Network $network Network value to return by path.
* @param string $domain The requested domain.
* @param string $path The requested path, in full.
* @param int|null $segments The suggested number of paths to consult.
* Default null, meaning the entire path was to be consulted.
* @param string[] $paths Array of paths to search for, based on `$path` and `$segments`.
*/
$pre = apply_filters( 'pre_get_network_by_path', null, $domain, $path, $segments, $paths );
if ( null !== $pre ) {
@ -413,13 +416,15 @@ class WP_Network {
}
if ( ! $using_paths ) {
$networks = get_networks( array(
'number' => 1,
'orderby' => array(
'domain_length' => 'DESC',
),
'domain__in' => $domains,
) );
$networks = get_networks(
array(
'number' => 1,
'orderby' => array(
'domain_length' => 'DESC',
),
'domain__in' => $domains,
)
);
if ( ! empty( $networks ) ) {
return array_shift( $networks );
@ -428,14 +433,16 @@ class WP_Network {
return false;
}
$networks = get_networks( array(
'orderby' => array(
'domain_length' => 'DESC',
'path_length' => 'DESC',
),
'domain__in' => $domains,
'path__in' => $paths,
) );
$networks = get_networks(
array(
'orderby' => array(
'domain_length' => 'DESC',
'path_length' => 'DESC',
),
'domain__in' => $domains,
'path__in' => $paths,
)
);
/*
* Domains are sorted by length of domain, then by length of path.