<!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>[38636] trunk/src/wp-includes: Multisite: Revert [38388].</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/38636">38636</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/38636","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>jeremyfelt</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-09-20 21:38:08 +0000 (Tue, 20 Sep 2016)</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: Revert <a href="https://core.trac.wordpress.org/changeset/38388">[38388]</a>.
Restore `get_current_site()` to a multisite only function. Providing this in single site may be a possibility in the future, but should have a dedicated ticket and discussion.
See <a href="https://core.trac.wordpress.org/ticket/37699">#37699</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
<li><a href="#trunksrcwpincludeslinktemplatephp">trunk/src/wp-includes/link-template.php</a></li>
<li><a href="#trunksrcwpincludesloadphp">trunk/src/wp-includes/load.php</a></li>
<li><a href="#trunksrcwpincludesmsblogsphp">trunk/src/wp-includes/ms-blogs.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>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesfunctionsphp"></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/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/functions.php 2016-09-20 20:51:18 UTC (rev 38635)
+++ trunk/src/wp-includes/functions.php 2016-09-20 21:38:08 UTC (rev 38636)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4309,19 +4309,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global object $current_site
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $site_id Optional. Site ID to test. Defaults to current site.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool True if $site_id is the main site of the network, or if not
</span><span class="cx" style="display: block; padding: 0 10px"> * running Multisite.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function is_main_site( $site_id = null ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! is_multisite() ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // This is the current network's information; 'site' is old terminology.
+ global $current_site;
+
+ if ( ! is_multisite() )
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><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 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $site_id )
</ins><span class="cx" style="display: block; padding: 0 10px"> $site_id = get_current_blog_id();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- return (int) $site_id === (int) get_current_site()->blog_id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ return (int) $site_id === (int) $current_site->blog_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="trunksrcwpincludeslinktemplatephp"></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/link-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/link-template.php 2016-09-20 20:51:18 UTC (rev 38635)
+++ trunk/src/wp-includes/link-template.php 2016-09-20 21:38:08 UTC (rev 38636)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3257,15 +3257,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $current_site = get_current_site();
</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 ( 'relative' == $scheme ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'relative' == $scheme )
</ins><span class="cx" style="display: block; padding: 0 10px"> $url = $current_site->path;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ else
</ins><span class="cx" style="display: block; padding: 0 10px"> $url = set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $path && is_string( $path ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $path && is_string( $path ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> $url .= ltrim( $path, '/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><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"> * Filters the network site URL.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3305,15 +3303,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) )
</span><span class="cx" style="display: block; padding: 0 10px"> $scheme = is_ssl() && ! is_admin() ? 'https' : 'http';
</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 ( 'relative' == $scheme ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'relative' == $scheme )
</ins><span class="cx" style="display: block; padding: 0 10px"> $url = $current_site->path;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ else
</ins><span class="cx" style="display: block; padding: 0 10px"> $url = set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $path && is_string( $path ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $path && is_string( $path ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> $url .= ltrim( $path, '/' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><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"> * Filters the network home URL.
</span></span></pre></div>
<a id="trunksrcwpincludesloadphp"></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/load.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/load.php 2016-09-20 20:51:18 UTC (rev 38635)
+++ trunk/src/wp-includes/load.php 2016-09-20 21:38:08 UTC (rev 38636)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1068,22 +1068,3 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function is_wp_error( $thing ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return ( $thing instanceof WP_Error );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-/**
- * Get the current network.
- *
- * Returns an object containing the 'id', 'domain', 'path', and 'site_name'
- * properties of the network being viewed.
- *
- * @see wpmu_current_site()
- *
- * @since MU
- *
- * @global WP_Network $current_site
- *
- * @return WP_Network
- */
-function get_current_site() {
- global $current_site;
- return $current_site;
-}
</del></span></pre></div>
<a id="trunksrcwpincludesmsblogsphp"></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-blogs.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-blogs.php 2016-09-20 20:51:18 UTC (rev 38635)
+++ trunk/src/wp-includes/ms-blogs.php 2016-09-20 21:38:08 UTC (rev 38636)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1088,11 +1088,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.6.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global WP_Network $current_site
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Network|int|null $network Optional. Network to retrieve. Default is the current network.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return WP_Network|null The network object or null if not found.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_network( $network = null ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $current_site = get_current_site();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global $current_site;
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $network ) && isset( $current_site ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $network = $current_site;
</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 2016-09-20 20:51:18 UTC (rev 38635)
+++ trunk/src/wp-includes/ms-functions.php 2016-09-20 21:38:08 UTC (rev 38636)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1332,7 +1332,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $blog_title The title of the new site.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function install_blog( $blog_id, $blog_title = '' ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $wpdb, $wp_roles;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global $wpdb, $wp_roles, $current_site;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Cast for security
</span><span class="cx" style="display: block; padding: 0 10px"> $blog_id = (int) $blog_id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1360,7 +1361,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'https' === parse_url( get_site_option( 'siteurl' ), PHP_URL_SCHEME ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $siteurl = set_url_scheme( $siteurl, 'https' );
</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 ( 'https' === parse_url( get_home_url( get_current_site()->blog_id ), PHP_URL_SCHEME ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'https' === parse_url( get_home_url( $current_site->blog_id ), PHP_URL_SCHEME ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $home = set_url_scheme( $home, 'https' );
</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">@@ -1497,9 +1498,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
</span><span class="cx" style="display: block; padding: 0 10px"> $message = $welcome_email;
</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( $current_site->site_name ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $current_site->site_name ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> $current_site->site_name = 'WordPress';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><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"> * Filters the subject of the welcome email after site activation.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1592,6 +1592,25 @@
</span><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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Get the current network.
+ *
+ * Returns an object containing the 'id', 'domain', 'path', and 'site_name'
+ * properties of the network being viewed.
+ *
+ * @see wpmu_current_site()
+ *
+ * @since MU
+ *
+ * @global WP_Network $current_site
+ *
+ * @return WP_Network
+ */
+function get_current_site() {
+ global $current_site;
+ return $current_site;
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Get a user's most recent post.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Walks through each of a user's blogs to find the post with
</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 2016-09-20 20:51:18 UTC (rev 38635)
+++ trunk/src/wp-includes/option.php 2016-09-20 21:38:08 UTC (rev 38636)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1070,6 +1070,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_option()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global object $current_site
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $network_id ID of the network. Can be null to default to the current network ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1077,7 +1078,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return mixed Value set for the option.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_network_option( $network_id, $option, $default = false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $wpdb;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global $wpdb, $current_site;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $network_id && ! is_numeric( $network_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1087,7 +1088,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fallback to the current network if a network ID is not specified.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $network_id && is_multisite() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $network_id = get_current_site()->id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $network_id = $current_site->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">@@ -1186,6 +1187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see add_option()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global object $current_site
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $network_id ID of the network. Can be null to default to the current network ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $option Name of option to add. Expected to not be SQL-escaped.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1193,7 +1195,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool False if option was not added and true if option was added.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_network_option( $network_id, $option, $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $wpdb;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global $wpdb, $current_site;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $network_id && ! is_numeric( $network_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1203,7 +1205,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fallback to the current network if a network ID is not specified.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $network_id && is_multisite() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $network_id = get_current_site()->id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $network_id = $current_site->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"> wp_protect_special_option( $option );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1295,13 +1297,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see delete_option()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global object $current_site
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $network_id ID of the network. Can be null to default to the current network ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $option Name of option to remove. Expected to not be SQL-escaped.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool True, if succeed. False, if failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function delete_network_option( $network_id, $option ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $wpdb;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global $wpdb, $current_site;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $network_id && ! is_numeric( $network_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1311,7 +1314,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fallback to the current network if a network ID is not specified.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $network_id && is_multisite() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $network_id = get_current_site()->id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $network_id = $current_site->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">@@ -1376,6 +1379,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see update_option()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global object $current_site
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $network_id ID of the network. Can be null to default to the current network ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $option Name of option. Expected to not be SQL-escaped.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1383,7 +1387,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool False if value was not updated and true if value was updated.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function update_network_option( $network_id, $option, $value ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global $wpdb;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global $wpdb, $current_site;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $network_id && ! is_numeric( $network_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1393,7 +1397,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fallback to the current network if a network ID is not specified.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $network_id && is_multisite() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $network_id = get_current_site()->id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $network_id = $current_site->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"> wp_protect_special_option( $option );
</span></span></pre>
</div>
</div>
</body>
</html>