<!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>[23658] trunk/wp-admin/includes: Replace deprecated WP_Screen::is_network property with WP_Screen::in_admin( 'network' ).</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, #logmsg > ol { margin-left: 0; 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">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23658">23658</a></dd>
<dt>Author</dt> <dd>SergeyBiryukov</dd>
<dt>Date</dt> <dd>2013-03-09 03:52:27 +0000 (Sat, 09 Mar 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Replace deprecated WP_Screen::is_network property with WP_Screen::in_admin( 'network' ). props bpetty. fixes <a href="http://core.trac.wordpress.org/ticket/23215">#23215</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswppluginslisttablephp">trunk/wp-admin/includes/class-wp-plugins-list-table.php</a></li>
<li><a href="#trunkwpadminincludesscreenphp">trunk/wp-admin/includes/screen.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesclasswppluginslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-plugins-list-table.php (23657 => 23658)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-plugins-list-table.php        2013-03-09 03:18:26 UTC (rev 23657)
+++ trunk/wp-admin/includes/class-wp-plugins-list-table.php        2013-03-09 03:52:27 UTC (rev 23658)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> 
</span><span class="cx">                 $screen = $this-&gt;screen;
</span><span class="cx"> 
</span><del>-                if ( ! is_multisite() || ( $screen-&gt;is_network &amp;&amp; current_user_can('manage_network_plugins') ) ) {
</del><ins>+                if ( ! is_multisite() || ( $screen-&gt;in_admin( 'network' ) &amp;&amp; current_user_can( 'manage_network_plugins' ) ) ) {
</ins><span class="cx">                         if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
</span><span class="cx">                                 $plugins['mustuse'] = get_mu_plugins();
</span><span class="cx">                         if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> 
</span><span class="cx">                 set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS );
</span><span class="cx"> 
</span><del>-                if ( ! $screen-&gt;is_network ) {
</del><ins>+                if ( ! $screen-&gt;in_admin( 'network' ) ) {
</ins><span class="cx">                         $recently_activated = get_option( 'recently_activated', array() );
</span><span class="cx"> 
</span><span class="cx">                         foreach ( $recently_activated as $key =&gt; $time )
</span><span class="lines">@@ -83,15 +83,15 @@
</span><span class="cx"> 
</span><span class="cx">                 foreach ( (array) $plugins['all'] as $plugin_file =&gt; $plugin_data ) {
</span><span class="cx">                         // Filter into individual sections
</span><del>-                        if ( is_multisite() &amp;&amp; ! $screen-&gt;is_network &amp;&amp; is_network_only_plugin( $plugin_file ) ) {
</del><ins>+                        if ( is_multisite() &amp;&amp; ! $screen-&gt;in_admin( 'network' ) &amp;&amp; is_network_only_plugin( $plugin_file ) ) {
</ins><span class="cx">                                 unset( $plugins['all'][ $plugin_file ] );
</span><del>-                        } elseif ( ! $screen-&gt;is_network &amp;&amp; is_plugin_active_for_network( $plugin_file ) ) {
</del><ins>+                        } elseif ( ! $screen-&gt;in_admin( 'network' ) &amp;&amp; is_plugin_active_for_network( $plugin_file ) ) {
</ins><span class="cx">                                 unset( $plugins['all'][ $plugin_file ] );
</span><del>-                        } elseif ( ( ! $screen-&gt;is_network &amp;&amp; is_plugin_active( $plugin_file ) )
-                                || ( $screen-&gt;is_network &amp;&amp; is_plugin_active_for_network( $plugin_file ) ) ) {
</del><ins>+                        } elseif ( ( ! $screen-&gt;in_admin( 'network' ) &amp;&amp; is_plugin_active( $plugin_file ) )
+                                || ( $screen-&gt;in_admin( 'network' ) &amp;&amp; is_plugin_active_for_network( $plugin_file ) ) ) {
</ins><span class="cx">                                 $plugins['active'][ $plugin_file ] = $plugin_data;
</span><span class="cx">                         } else {
</span><del>-                                if ( ! $screen-&gt;is_network &amp;&amp; isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
</del><ins>+                                if ( ! $screen-&gt;in_admin( 'network' ) &amp;&amp; isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
</ins><span class="cx">                                         $plugins['recently_activated'][ $plugin_file ] = $plugin_data;
</span><span class="cx">                                 $plugins['inactive'][ $plugin_file ] = $plugin_data;
</span><span class="cx">                         }
</span><span class="lines">@@ -237,12 +237,12 @@
</span><span class="cx">                 $actions = array();
</span><span class="cx"> 
</span><span class="cx">                 if ( 'active' != $status )
</span><del>-                        $actions['activate-selected'] = $this-&gt;screen-&gt;is_network ? __( 'Network Activate' ) : __( 'Activate' );
</del><ins>+                        $actions['activate-selected'] = $this-&gt;screen-&gt;in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' );
</ins><span class="cx"> 
</span><span class="cx">                 if ( 'inactive' != $status &amp;&amp; 'recent' != $status )
</span><del>-                        $actions['deactivate-selected'] = $this-&gt;screen-&gt;is_network ? __( 'Network Deactivate' ) : __( 'Deactivate' );
</del><ins>+                        $actions['deactivate-selected'] = $this-&gt;screen-&gt;in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' );
</ins><span class="cx"> 
</span><del>-                if ( !is_multisite() || $this-&gt;screen-&gt;is_network ) {
</del><ins>+                if ( !is_multisite() || $this-&gt;screen-&gt;in_admin( 'network' ) ) {
</ins><span class="cx">                         if ( current_user_can( 'update_plugins' ) )
</span><span class="cx">                                 $actions['update-selected'] = __( 'Update' );
</span><span class="cx">                         if ( current_user_can( 'delete_plugins' ) &amp;&amp; ( 'active' != $status ) )
</span><span class="lines">@@ -269,7 +269,7 @@
</span><span class="cx"> 
</span><span class="cx">                 echo '&lt;div class=&quot;alignleft actions&quot;&gt;';
</span><span class="cx"> 
</span><del>-                if ( ! $this-&gt;screen-&gt;is_network &amp;&amp; 'recently_activated' == $status )
</del><ins>+                if ( ! $this-&gt;screen-&gt;in_admin( 'network' ) &amp;&amp; 'recently_activated' == $status )
</ins><span class="cx">                         submit_button( __( 'Clear List' ), 'button', 'clear-recent-list', false );
</span><span class="cx">                 elseif ( 'top' == $which &amp;&amp; 'mustuse' == $status )
</span><span class="cx">                         echo '&lt;p&gt;' . sprintf( __( 'Files in the &lt;code&gt;%s&lt;/code&gt; directory are executed automatically.' ), str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) ) . '&lt;/p&gt;';
</span><span class="lines">@@ -289,7 +289,7 @@
</span><span class="cx">         function display_rows() {
</span><span class="cx">                 global $status;
</span><span class="cx"> 
</span><del>-                if ( is_multisite() &amp;&amp; ! $this-&gt;screen-&gt;is_network &amp;&amp; in_array( $status, array( 'mustuse', 'dropins' ) ) )
</del><ins>+                if ( is_multisite() &amp;&amp; ! $this-&gt;screen-&gt;in_admin( 'network' ) &amp;&amp; in_array( $status, array( 'mustuse', 'dropins' ) ) )
</ins><span class="cx">                         return;
</span><span class="cx"> 
</span><span class="cx">                 foreach ( $this-&gt;items as $plugin_file =&gt; $plugin_data )
</span><span class="lines">@@ -331,12 +331,12 @@
</span><span class="cx">                         if ( $plugin_data['Description'] )
</span><span class="cx">                                 $description .= '&lt;p&gt;' . $plugin_data['Description'] . '&lt;/p&gt;';
</span><span class="cx">                 } else {
</span><del>-                        if ( $screen-&gt;is_network )
</del><ins>+                        if ( $screen-&gt;in_admin( 'network' ) )
</ins><span class="cx">                                 $is_active = is_plugin_active_for_network( $plugin_file );
</span><span class="cx">                         else
</span><span class="cx">                                 $is_active = is_plugin_active( $plugin_file );
</span><span class="cx"> 
</span><del>-                        if ( $screen-&gt;is_network ) {
</del><ins>+                        if ( $screen-&gt;in_admin( 'network' ) ) {
</ins><span class="cx">                                 if ( $is_active ) {
</span><span class="cx">                                         if ( current_user_can( 'manage_network_plugins' ) )
</span><span class="cx">                                                 $actions['deactivate'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=deactivate&amp;amp;plugin=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page . '&amp;amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '&quot; title=&quot;' . esc_attr__('Deactivate this plugin') . '&quot;&gt;' . __('Network Deactivate') . '&lt;/a&gt;';
</span><span class="lines">@@ -355,13 +355,13 @@
</span><span class="cx">                                         if ( ! is_multisite() &amp;&amp; current_user_can('delete_plugins') )
</span><span class="cx">                                                 $actions['delete'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=delete-selected&amp;amp;checked[]=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page . '&amp;amp;s=' . $s, 'bulk-plugins') . '&quot; title=&quot;' . esc_attr__('Delete this plugin') . '&quot; class=&quot;delete&quot;&gt;' . __('Delete') . '&lt;/a&gt;';
</span><span class="cx">                                 } // end if $is_active
</span><del>-                         } // end if $screen-&gt;is_network
</del><ins>+                         } // end if $screen-&gt;in_admin( 'network' )
</ins><span class="cx"> 
</span><del>-                        if ( ( ! is_multisite() || $screen-&gt;is_network ) &amp;&amp; current_user_can('edit_plugins') &amp;&amp; is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
</del><ins>+                        if ( ( ! is_multisite() || $screen-&gt;in_admin( 'network' ) ) &amp;&amp; current_user_can('edit_plugins') &amp;&amp; is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
</ins><span class="cx">                                 $actions['edit'] = '&lt;a href=&quot;plugin-editor.php?file=' . $plugin_file . '&quot; title=&quot;' . esc_attr__('Open this file in the Plugin Editor') . '&quot; class=&quot;edit&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
</span><span class="cx">                 } // end if $context
</span><span class="cx"> 
</span><del>-                $prefix = $screen-&gt;is_network ? 'network_admin_' : '';
</del><ins>+                $prefix = $screen-&gt;in_admin( 'network' ) ? 'network_admin_' : '';
</ins><span class="cx">                 $actions = apply_filters( $prefix . 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context );
</span><span class="cx">                 $actions = apply_filters( $prefix . &quot;plugin_action_links_$plugin_file&quot;, $actions, $plugin_file, $plugin_data, $context );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminincludesscreenphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/screen.php (23657 => 23658)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/screen.php        2013-03-09 03:18:26 UTC (rev 23657)
+++ trunk/wp-admin/includes/screen.php        2013-03-09 03:52:27 UTC (rev 23658)
</span><span class="lines">@@ -319,20 +319,20 @@
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * The help tab data associated with the screen, if any.
</span><del>-          *
-          * @since 3.3.0
-          * @var array
-          * @access private
-          */
</del><ins>+         *
+         * @since 3.3.0
+         * @var array
+         * @access private
+         */
</ins><span class="cx">         private $_help_tabs = array();
</span><span class="cx"> 
</span><del>-         /**
</del><ins>+        /**
</ins><span class="cx">          * The help sidebar data associated with screen, if any.
</span><span class="cx">          *
</span><span class="cx">          * @since 3.3.0
</span><span class="cx">          * @var string
</span><span class="cx">          * @access private
</span><del>-          */
</del><ins>+         */
</ins><span class="cx">         private $_help_sidebar = '';
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="lines">@@ -376,16 +376,16 @@
</span><span class="cx">          */
</span><span class="cx">         private $_screen_settings;
</span><span class="cx"> 
</span><del>-         /**
</del><ins>+        /**
</ins><span class="cx">          * Fetches a screen object.
</span><del>-          *
-          * @since 3.3.0
</del><ins>+         *
+         * @since 3.3.0
</ins><span class="cx">          * @access public
</span><del>-          *
</del><ins>+         *
</ins><span class="cx">          * @param string $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen.
</span><span class="cx">          *         Defaults to the current $hook_suffix global.
</span><span class="cx">          * @return WP_Screen Screen object.
</span><del>-          */
</del><ins>+         */
</ins><span class="cx">         public static function get( $hook_name = '' ) {
</span><span class="cx"> 
</span><span class="cx">                 if ( is_a( $hook_name, 'WP_Screen' ) )
</span><span class="lines">@@ -427,13 +427,13 @@
</span><span class="cx">                         if ( 'edit-comments' != $id &amp;&amp; 'edit-tags' != $id &amp;&amp; 'edit-' == substr( $id, 0, 5 ) ) {
</span><span class="cx">                                 $maybe = substr( $id, 5 );
</span><span class="cx">                                 if ( taxonomy_exists( $maybe ) ) {
</span><del>-                                         $id = 'edit-tags';
</del><ins>+                                        $id = 'edit-tags';
</ins><span class="cx">                                         $taxonomy = $maybe;
</span><span class="cx">                                 } elseif ( post_type_exists( $maybe ) ) {
</span><span class="cx">                                         $id = 'edit';
</span><span class="cx">                                         $post_type = $maybe;
</span><span class="cx">                                 }
</span><del>-                         }
</del><ins>+                        }
</ins><span class="cx"> 
</span><span class="cx">                         if ( ! $in_admin )
</span><span class="cx">                                 $in_admin = 'site';
</span><span class="lines">@@ -480,7 +480,7 @@
</span><span class="cx">                                                 $post_type = 'post';
</span><span class="cx">                                         break;
</span><span class="cx">                         }
</span><del>-                 }
</del><ins>+                }
</ins><span class="cx"> 
</span><span class="cx">                 switch ( $base ) {
</span><span class="cx">                         case 'post' :
</span><span class="lines">@@ -513,7 +513,7 @@
</span><span class="cx">                 } elseif ( 'user' == $in_admin ) {
</span><span class="cx">                         $id   .= '-user';
</span><span class="cx">                         $base .= '-user';
</span><del>-                 }
</del><ins>+                }
</ins><span class="cx"> 
</span><span class="cx">                 if ( isset( self::$_registry[ $id ] ) ) {
</span><span class="cx">                         $screen = self::$_registry[ $id ];
</span><span class="lines">@@ -535,7 +535,7 @@
</span><span class="cx">                 self::$_registry[ $id ] = $screen;
</span><span class="cx"> 
</span><span class="cx">                 return $screen;
</span><del>-         }
</del><ins>+        }
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * Makes the screen object the current screen.
</span></span></pre>
</div>
</div>

</body>
</html>