rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -31,12 +31,12 @@ function wpmu_update_blogs_date() {
}
/**
* Gets a full blog URL, given a blog ID.
* Gets a full site URL, given a site ID.
*
* @since MU (3.0.0)
*
* @param int $blog_id Blog ID.
* @return string Full URL of the blog if found. Empty string if not.
* @param int $blog_id Site ID.
* @return string Full site URL if found. Empty string if not.
*/
function get_blogaddress_by_id( $blog_id ) {
$bloginfo = get_site( (int) $blog_id );
@@ -52,7 +52,7 @@ function get_blogaddress_by_id( $blog_id ) {
}
/**
* Gets a full blog URL, given a blog name.
* Gets a full site URL, given a site name.
*
* @since MU (3.0.0)
*
@@ -137,7 +137,7 @@ function get_blog_details( $fields = null, $get_all = true ) {
if ( false !== $blog ) {
return $blog;
}
if ( 'www.' === substr( $fields['domain'], 0, 4 ) ) {
if ( str_starts_with( $fields['domain'], 'www.' ) ) {
$nowww = substr( $fields['domain'], 4 );
$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) AND path = %s ORDER BY CHAR_LENGTH(domain) DESC", $nowww, $fields['domain'], $fields['path'] ) );
} else {
@@ -155,7 +155,7 @@ function get_blog_details( $fields = null, $get_all = true ) {
if ( false !== $blog ) {
return $blog;
}
if ( 'www.' === substr( $fields['domain'], 0, 4 ) ) {
if ( str_starts_with( $fields['domain'], 'www.' ) ) {
$nowww = substr( $fields['domain'], 4 );
$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) ORDER BY CHAR_LENGTH(domain) DESC", $nowww, $fields['domain'] ) );
} else {
@@ -419,7 +419,7 @@ function add_blog_option( $id, $option, $value ) {
}
/**
* Removes option by name for a given blog ID. Prevents removal of protected WordPress options.
* Removes an option by name for a given blog ID. Prevents removal of protected WordPress options.
*
* @since MU (3.0.0)
*
@@ -560,16 +560,18 @@ function switch_to_blog( $new_blog_id, $deprecated = null ) {
'blog_meta',
'global-posts',
'networks',
'network-queries',
'sites',
'site-details',
'site-options',
'site-queries',
'site-transient',
'rss',
'users',
'user-queries',
'user_meta',
'useremail',
'userlogins',
'usermeta',
'user_meta',
'userslugs',
)
);
@@ -651,16 +653,18 @@ function restore_current_blog() {
'blog_meta',
'global-posts',
'networks',
'network-queries',
'sites',
'site-details',
'site-options',
'site-queries',
'site-transient',
'rss',
'users',
'user-queries',
'user_meta',
'useremail',
'userlogins',
'usermeta',
'user_meta',
'userslugs',
)
);