<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[41241] trunk/src: Multisite: Rename internal `$site_id` variables referencing networks to `$network_id`.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/41241">41241</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/41241","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>flixos90</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-08-12 12:47:38 +0000 (Sat, 12 Aug 2017)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Multisite: Rename internal `$site_id` variables referencing networks to `$network_id`.
This change improves code clarity by using the current naming conventions for networks.
Props lemacarl.
Fixes <a href="https://core.trac.wordpress.org/ticket/41510">#41510</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesmsphp">trunk/src/wp-admin/includes/ms.php</a></li>
<li><a href="#trunksrcwpincludesmsdeprecatedphp">trunk/src/wp-includes/ms-deprecated.php</a></li>
<li><a href="#trunksrcwpincludesmsfunctionsphp">trunk/src/wp-includes/ms-functions.php</a></li>
<li><a href="#trunksrcwpincludesoptionphp">trunk/src/wp-includes/option.php</a></li>
<li><a href="#trunksrcwpincludeswpdbphp">trunk/src/wp-includes/wp-db.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesmsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ms.php 2017-08-12 06:19:28 UTC (rev 41240)
+++ trunk/src/wp-admin/includes/ms.php 2017-08-12 12:47:38 UTC (rev 41241)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -787,20 +787,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether or not we can edit this network from this page.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * By default editing of network is restricted to the Network Admin for that `$site_id`
- * this allows for this to be overridden.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * By default editing of network is restricted to the Network Admin for that `$network_id`.
+ * This function allows for this to be overridden.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb WordPress database abstraction object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $site_id The network/site ID to check.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $network_id The network ID to check.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True if network can be edited, otherwise false.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function can_edit_network( $site_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function can_edit_network( $network_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $site_id == $wpdb->siteid )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $network_id == $wpdb->siteid )
</ins><span class="cx" style="display: block; padding: 0 10px"> $result = true;
</span><span class="cx" style="display: block; padding: 0 10px"> else
</span><span class="cx" style="display: block; padding: 0 10px"> $result = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -810,10 +810,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param bool $result Whether the network can be edited from this page.
- * @param int $site_id The network/site ID to check.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $result Whether the network can be edited from this page.
+ * @param int $network_id The network ID to check.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'can_edit_network', $result, $site_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'can_edit_network', $result, $network_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesmsdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ms-deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-deprecated.php 2017-08-12 06:19:28 UTC (rev 41240)
+++ trunk/src/wp-includes/ms-deprecated.php 2017-08-12 12:47:38 UTC (rev 41241)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -420,22 +420,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb WordPress database abstraction object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $sitedomain Optional. Site domain.
- * @param string $path Optional. Site path.
- * @return array|false The network admins
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $domain Optional. Network domain.
+ * @param string $path Optional. Network path.
+ * @return array|false The network admins.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function get_admin_users_for_domain( $domain = '', $path = '' ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> _deprecated_function( __FUNCTION__, '4.4.0' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $sitedomain )
- $site_id = $wpdb->siteid;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $domain )
+ $network_id = $wpdb->siteid;
</ins><span class="cx" style="display: block; padding: 0 10px"> else
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $site_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $network_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $domain, $path ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $site_id )
- return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $site_id ), ARRAY_A );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $network_id )
+ return $wpdb->get_results( $wpdb->prepare( "SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $network_id ), ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/ms-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-functions.php 2017-08-12 06:19:28 UTC (rev 41240)
+++ trunk/src/wp-includes/ms-functions.php 2017-08-12 12:47:38 UTC (rev 41241)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1171,22 +1171,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since MU (3.0.0)
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $domain The new site's domain.
- * @param string $path The new site's path.
- * @param string $title The new site's title.
- * @param int $user_id The user ID of the new site's admin.
- * @param array $meta Optional. Array of key=>value pairs used to set initial site options.
- * If valid status keys are included ('public', 'archived', 'mature',
- * 'spam', 'deleted', or 'lang_id') the given site status(es) will be
- * updated. Otherwise, keys and values will be used to set options for
- * the new site. Default empty array.
- * @param int $site_id Optional. Network ID. Only relevant on multi-network installs.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $domain The new site's domain.
+ * @param string $path The new site's path.
+ * @param string $title The new site's title.
+ * @param int $user_id The user ID of the new site's admin.
+ * @param array $meta Optional. Array of key=>value pairs used to set initial site options.
+ * If valid status keys are included ('public', 'archived', 'mature',
+ * 'spam', 'deleted', or 'lang_id') the given site status(es) will be
+ * updated. Otherwise, keys and values will be used to set options for
+ * the new site. Default empty array.
+ * @param int $network_id Optional. Network ID. Only relevant on multi-network installs.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int|WP_Error Returns WP_Error object on failure, the new site ID on success.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $site_id = 1 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $network_id = 1 ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $defaults = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'public' => 0,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'WPLANG' => get_network_option( $site_id, 'WPLANG' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'WPLANG' => get_network_option( $network_id, 'WPLANG' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $meta = wp_parse_args( $meta, $defaults );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1202,14 +1202,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $path = '/';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Check if the domain has been used already. We should return an error message.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( domain_exists($domain, $path, $site_id) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( domain_exists($domain, $path, $network_id) )
</ins><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'blog_taken', __( 'Sorry, that site already exists!' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! wp_installing() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_installing( true );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $blog_id = insert_blog($domain, $path, $network_id) )
</ins><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error('insert_blog', __('Could not create site.'));
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch_to_blog($blog_id);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1236,14 +1236,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since MU (3.0.0)
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $blog_id Site ID.
- * @param int $user_id User ID.
- * @param string $domain Site domain.
- * @param string $path Site path.
- * @param int $site_id Network ID. Only relevant on multi-network installs.
- * @param array $meta Meta data. Used to set initial site options.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $blog_id Site ID.
+ * @param int $user_id User ID.
+ * @param string $domain Site domain.
+ * @param string $path Site path.
+ * @param int $network_id Network ID. Only relevant on multi-network installs.
+ * @param array $meta Meta data. Used to set initial site options.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $network_id, $meta );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( 'last_changed', microtime(), 'sites' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1350,18 +1350,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb WordPress database abstraction object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $domain The domain to be checked.
- * @param string $path The path to be checked.
- * @param int $site_id Optional. Relevant only on multi-network installs.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $domain The domain to be checked.
+ * @param string $path The path to be checked.
+ * @param int $network_id Optional. Network ID. Relevant only on multi-network installs.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function domain_exists($domain, $path, $site_id = 1) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function domain_exists( $domain, $path, $network_id = 1 ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $path = trailingslashit( $path );
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'network_id' => $site_id,
- 'domain' => $domain,
- 'path' => $path,
- 'fields' => 'ids',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'network_id' => $network_id,
+ 'domain' => $domain,
+ 'path' => $path,
+ 'fields' => 'ids',
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = get_sites( $args );
</span><span class="cx" style="display: block; padding: 0 10px"> $result = array_shift( $result );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1371,12 +1371,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int|null $result The blog_id if the blogname exists, null otherwise.
- * @param string $domain Domain to be checked.
- * @param string $path Path to be checked.
- * @param int $site_id Site ID. Relevant only on multi-network installs.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int|null $result The blog_id if the blogname exists, null otherwise.
+ * @param string $domain Domain to be checked.
+ * @param string $path Path to be checked.
+ * @param int $network_id Network ID. Relevant only on multi-network installs.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'domain_exists', $result, $domain, $path, $site_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'domain_exists', $result, $domain, $path, $network_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1389,25 +1389,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb WordPress database abstraction object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $domain The domain of the new site.
- * @param string $path The path of the new site.
- * @param int $site_id Unless you're running a multi-network install, be sure to set this value to 1.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $domain The domain of the new site.
+ * @param string $path The path of the new site.
+ * @param int $network_id Unless you're running a multi-network install, be sure to set this value to 1.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int|false The ID of the new row
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function insert_blog($domain, $path, $site_id) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function insert_blog($domain, $path, $network_id) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $path = trailingslashit($path);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $site_id = (int) $site_id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $network_id = (int) $network_id;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $result = $wpdb->insert( $wpdb->blogs, array('site_id' => $site_id, 'domain' => $domain, 'path' => $path, 'registered' => current_time('mysql')) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $result = $wpdb->insert( $wpdb->blogs, array('site_id' => $network_id, 'domain' => $domain, 'path' => $path, 'registered' => current_time('mysql')) );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $result )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_id = $wpdb->insert_id;
</span><span class="cx" style="display: block; padding: 0 10px"> refresh_blog_details( $blog_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_maybe_update_network_site_counts( $site_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_maybe_update_network_site_counts( $network_id );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $blog_id;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesoptionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/option.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/option.php 2017-08-12 06:19:28 UTC (rev 41240)
+++ trunk/src/wp-includes/option.php 2017-08-12 12:47:38 UTC (rev 41241)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -214,25 +214,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb WordPress database abstraction object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $site_id Optional site ID for which to query the options. Defaults to the current site.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $network_id Optional site ID for which to query the options. Defaults to the current site.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_load_core_site_options( $site_id = null ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_load_core_site_options( $network_id = null ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_multisite() || wp_using_ext_object_cache() || wp_installing() )
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty($site_id) )
- $site_id = $wpdb->siteid;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty($network_id) )
+ $network_id = $wpdb->siteid;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'can_compress_scripts', 'global_terms_enabled', 'ms_files_rewriting' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $core_options_in = "'" . implode("', '", $core_options) . "'";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $options = $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d", $site_id) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $options = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d", $network_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $options as $option ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $key = $option->meta_key;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $cache_key = "{$site_id}:$key";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $cache_key = "{$network_id}:$key";
</ins><span class="cx" style="display: block; padding: 0 10px"> $option->meta_value = maybe_unserialize( $option->meta_value );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( $cache_key, $option->meta_value, 'site-options' );
</span></span></pre></div>
<a id="trunksrcwpincludeswpdbphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/wp-db.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/wp-db.php 2017-08-12 06:19:28 UTC (rev 41240)
+++ trunk/src/wp-includes/wp-db.php 2017-08-12 12:47:38 UTC (rev 41241)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -893,12 +893,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $blog_id
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $site_id Optional.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $network_id Optional.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int previous blog id
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function set_blog_id( $blog_id, $site_id = 0 ) {
- if ( ! empty( $site_id ) )
- $this->siteid = $site_id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function set_blog_id( $blog_id, $network_id = 0 ) {
+ if ( ! empty( $network_id ) ) {
+ $this->siteid = $network_id;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $old_blog_id = $this->blogid;
</span><span class="cx" style="display: block; padding: 0 10px"> $this->blogid = $blog_id;
</span></span></pre>
</div>
</div>
</body>
</html>