WordPress.org

Make WordPress Core

Ticket #16490: in_admin_inc_deprecated.patch

File in_admin_inc_deprecated.patch, 42.1 KB (added by apeatling, 7 years ago)

Patch including deprecated is_x_admin() functions.

  • wp-includes/admin-bar.php

     
    347347                if ( ! is_user_logged_in() ) {
    348348                        $show_admin_bar = false;
    349349                } else {
    350                         $context = is_admin() ? 'admin' : 'front';
     350                        $context = in_admin() ? 'admin' : 'front';
    351351                        $show_admin_bar = _get_admin_bar_pref( $context );
    352352                }
    353353        }
  • wp-includes/default-filters.php

     
    2121
    2222// Strip, kses, special chars for string display
    2323foreach ( array( 'term_name', 'comment_author_name', 'link_name', 'link_target', 'link_rel', 'user_display_name', 'user_first_name', 'user_last_name', 'user_nickname' ) as $filter ) {
    24         if ( is_admin() ) {
     24        if ( in_admin() ) {
    2525                // These are expensive. Run only on admin pages for defense in depth.
    2626                add_filter( $filter, 'sanitize_text_field'  );
    2727                add_filter( $filter, 'wp_kses_data'       );
     
    3535}
    3636
    3737// Kses only for textarea admin displays
    38 if ( is_admin() ) {
     38if ( in_admin() ) {
    3939        foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description', 'comment_text' ) as $filter ) {
    4040                add_filter( $filter, 'wp_kses_data' );
    4141        }
     
    5151// Email admin display
    5252foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) {
    5353        add_filter( $filter, 'sanitize_email' );
    54         if ( is_admin() )
     54        if ( in_admin() )
    5555                add_filter( $filter, 'wp_kses_data' );
    5656}
    5757
     
    6565
    6666// Display URL
    6767foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url' ) as $filter ) {
    68         if ( is_admin() )
     68        if ( in_admin() )
    6969                add_filter( $filter, 'wp_strip_all_tags' );
    7070        add_filter( $filter, 'esc_url'           );
    71         if ( is_admin() )
     71        if ( in_admin() )
    7272                add_filter( $filter, 'wp_kses_data'    );
    7373}
    7474
  • wp-includes/post-template.php

     
    107107        $title = isset($post->post_title) ? $post->post_title : '';
    108108        $id = isset($post->ID) ? $post->ID : (int) $id;
    109109
    110         if ( !is_admin() ) {
     110        if ( !in_admin() ) {
    111111                if ( !empty($post->post_password) ) {
    112112                        $protected_title_format = apply_filters('protected_title_format', __('Protected: %s'));
    113113                        $title = sprintf($protected_title_format, $title);
  • wp-includes/default-widgets.php

     
    103103                $show_images = isset($instance['images']) ? $instance['images'] : true;
    104104                $category = isset($instance['category']) ? $instance['category'] : false;
    105105
    106                 if ( is_admin() && !$category ) {
     106                if ( in_admin() && !$category ) {
    107107                        // Display All Links widget as such in the widgets screen
    108108                        echo $before_widget . $before_title. __('All Links') . $after_title . $after_widget;
    109109                        return;
     
    784784        }
    785785
    786786        if ( is_wp_error($rss) ) {
    787                 if ( is_admin() || current_user_can('manage_options') )
     787                if ( in_admin() || current_user_can('manage_options') )
    788788                        echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>';
    789789                return;
    790790        }
  • wp-includes/theme.php

     
    12541254        }
    12551255        delete_option('current_theme');
    12561256        $theme = get_current_theme();
    1257         if ( is_admin() && false === get_option( "theme_mods_$stylesheet" ) ) {
     1257        if ( in_admin() && false === get_option( "theme_mods_$stylesheet" ) ) {
    12581258                $default_theme_mods = (array) get_option( "mods_$theme" );
    12591259                add_option( "theme_mods_$stylesheet", $default_theme_mods );
    12601260        }
     
    13091309        if ( false === ( $mods = get_option( "theme_mods_$theme_slug" ) ) ) {
    13101310                $theme_name = get_current_theme();
    13111311                $mods = get_option( "mods_$theme_name" ); // Deprecated location.
    1312                 if ( is_admin() && false !== $mods ) {
     1312                if ( in_admin() && false !== $mods ) {
    13131313                        update_option( "theme_mods_$theme_slug", $mods );
    13141314                        delete_option( "mods_$theme_name" );
    13151315                }
     
    14691469        add_theme_support( 'custom-header', array( 'callback' => $header_callback ) );
    14701470        add_theme_support( 'custom-header-uploads' );
    14711471
    1472         if ( ! is_admin() )
     1472        if ( ! in_admin() )
    14731473                return;
    14741474
    14751475        global $custom_image_header;
     
    14961496        _remove_theme_support( 'custom-header' );
    14971497        remove_theme_support( 'custom-header-uploads' );
    14981498
    1499         if ( is_admin() ) {
     1499        if ( in_admin() ) {
    15001500                remove_action( 'admin_menu', array( &$GLOBALS['custom_image_header'], 'init' ) );
    15011501                unset( $GLOBALS['custom_image_header'] );
    15021502        }
     
    16121612
    16131613        add_theme_support( 'custom-background', array( 'callback' => $header_callback ) );
    16141614
    1615         if ( ! is_admin() )
     1615        if ( ! in_admin() )
    16161616                return;
    16171617        require_once( ABSPATH . 'wp-admin/custom-background.php' );
    16181618        $GLOBALS['custom_background'] =& new Custom_Background( $admin_header_callback, $admin_image_div_callback );
     
    16351635        remove_action( 'wp_head', $callback[0]['callback'] );
    16361636        _remove_theme_support( 'custom-background' );
    16371637
    1638         if ( is_admin() ) {
     1638        if ( in_admin() ) {
    16391639                remove_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) );
    16401640                unset( $GLOBALS['custom_background'] );
    16411641        }
     
    17051705
    17061706        add_theme_support( 'editor-style' );
    17071707
    1708         if ( ! is_admin() )
     1708        if ( ! in_admin() )
    17091709                return;
    17101710
    17111711        global $editor_styles;
     
    17301730        if ( ! current_theme_supports( 'editor-style' ) )
    17311731                return false;
    17321732        _remove_theme_support( 'editor-style' );
    1733         if ( is_admin() )
     1733        if ( in_admin() )
    17341734                $GLOBALS['editor_styles'] = array();
    17351735        return true;
    17361736}
  • wp-includes/functions.php

     
    819819 */
    820820function wp_user_settings() {
    821821
    822         if ( ! is_admin() )
     822        if ( ! in_admin() )
    823823                return;
    824824
    825825        if ( defined('DOING_AJAX') )
  • wp-includes/vars.php

     
    1313 */
    1414
    1515// On which page are we ?
    16 if ( is_admin() ) {
     16if ( in_admin() ) {
    1717        // wp-admin pages are checked more carefully
    18         if ( is_network_admin() )
     18        if ( in_network_admin() )
    1919                preg_match('#/wp-admin/network/?(.*?)$#i', $PHP_SELF, $self_matches);
    20         elseif ( is_user_admin() )
     20        elseif ( in_user_admin() )
    2121                preg_match('#/wp-admin/user/?(.*?)$#i', $PHP_SELF, $self_matches);
    2222        else
    2323                preg_match('#/wp-admin/?(.*?)$#i', $PHP_SELF, $self_matches);
  • wp-includes/load.php

     
    570570}
    571571
    572572/**
    573  * Whether the current request is for a network or blog admin page
     573 * Checks to see if the current request is inside any type of WordPress administration page. /wp-admin/*
    574574 *
    575  * Does not inform on whether the user is an admin! Use capability checks to
    576  * tell if the user should be accessing a section or not.
     575 * @since 3.1.0
    577576 *
    578  * @since 1.5.1
    579  *
    580  * @return bool True if inside WordPress administration pages.
     577 * @return bool True if inside any WordPress administration page.
    581578 */
    582 function is_admin() {
     579function in_admin() {
    583580        if ( defined( 'WP_ADMIN' ) )
    584581                return WP_ADMIN;
    585582        return false;
    586583}
    587584
    588585/**
    589  * Whether the current request is for a blog admin screen /wp-admin/
     586 * Checks to see if the current request is inside a blog admin screen /wp-admin/
    590587 *
    591  * Does not inform on whether the user is a blog admin! Use capability checks to
    592  * tell if the user should be accessing a section or not.
    593  *
    594588 * @since 3.1.0
    595589 *
    596  * @return bool True if inside WordPress network administration pages.
     590 * @return bool True if inside WordPress blog administration pages.
    597591 */
    598 function is_blog_admin() {
     592function in_blog_admin() {
    599593        if ( defined( 'WP_BLOG_ADMIN' ) )
    600594                return WP_BLOG_ADMIN;
    601595        return false;
    602596}
    603597
    604598/**
    605  * Whether the current request is for a network admin screen /wp-admin/network/
     599 * Checks to see if the current request is inside a network admin screen /wp-admin/network/
    606600 *
    607  * Does not inform on whether the user is a network admin! Use capability checks to
    608  * tell if the user should be accessing a section or not.
    609  *
    610601 * @since 3.1.0
    611602 *
    612603 * @return bool True if inside WordPress network administration pages.
    613604 */
    614 function is_network_admin() {
     605function in_network_admin() {
    615606        if ( defined( 'WP_NETWORK_ADMIN' ) )
    616607                return WP_NETWORK_ADMIN;
    617608        return false;
    618609}
    619610
    620611/**
    621  * Whether the current request is for a user admin screen /wp-admin/user/
     612 * Checks to see if the current request is inside a user admin screen /wp-admin/user/
    622613 *
    623  * Does not inform on whether the user is an admin! Use capability checks to
    624  * tell if the user should be accessing a section or not.
    625  *
    626614 * @since 3.1.0
    627615 *
    628616 * @return bool True if inside WordPress user administration pages.
    629617 */
    630 function is_user_admin() {
     618function in_user_admin() {
    631619        if ( defined( 'WP_USER_ADMIN' ) )
    632620                return WP_USER_ADMIN;
    633621        return false;
  • wp-includes/media.php

     
    6464        } elseif ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ) ) ) {
    6565                $max_width = intval( $_wp_additional_image_sizes[$size]['width'] );
    6666                $max_height = intval( $_wp_additional_image_sizes[$size]['height'] );
    67                 if ( intval($content_width) > 0 && is_admin() ) // Only in admin. Assume that theme authors know what they're doing.
     67                if ( intval($content_width) > 0 && in_admin() ) // Only in admin. Assume that theme authors know what they're doing.
    6868                        $max_width = min( intval($content_width), $max_width );
    6969        }
    7070        // $size == 'full' has no constraint
  • wp-includes/query.php

     
    15501550                if ( '' != $qv['preview'] )
    15511551                        $this->is_preview = true;
    15521552
    1553                 if ( is_admin() )
     1553                if ( in_admin() )
    15541554                        $this->is_admin = true;
    15551555
    15561556                if ( false !== strpos($qv['feed'], 'comments-') ) {
     
    24192419                                $where .= " OR $wpdb->posts.post_status = '$state'";
    24202420                        }
    24212421
    2422                         if ( is_admin() ) {
     2422                        if ( in_admin() ) {
    24232423                                // Add protected states that should show in the admin all list.
    24242424                                $admin_all_states = get_post_stati( array('protected' => true, 'show_in_admin_all_list' => true) );
    24252425                                foreach ( (array) $admin_all_states as $state )
  • wp-includes/link-template.php

     
    14891489        $request = preg_replace('|^'. $home_root . '|', '', $request);
    14901490        $request = preg_replace('|^/+|', '', $request);
    14911491
    1492         if ( !$wp_rewrite->using_permalinks() || is_admin() ) {
     1492        if ( !$wp_rewrite->using_permalinks() || in_admin() ) {
    14931493                $base = trailingslashit( get_bloginfo( 'url' ) );
    14941494
    14951495                if ( $pagenum > 1 ) {
     
    19531953        $orig_scheme = $scheme;
    19541954
    19551955        if ( !in_array( $scheme, array( 'http', 'https' ) ) )
    1956                 $scheme = is_ssl() && !is_admin() ? 'https' : 'http';
     1956                $scheme = is_ssl() && !in_admin() ? 'https' : 'http';
    19571957
    19581958        if ( empty( $blog_id ) || !is_multisite() )
    19591959                $url = get_option( 'home' );
     
    22062206        $orig_scheme = $scheme;
    22072207
    22082208        if ( !in_array($scheme, array('http', 'https')) )
    2209                 $scheme = is_ssl() && !is_admin() ? 'https' : 'http';
     2209                $scheme = is_ssl() && !in_admin() ? 'https' : 'http';
    22102210
    22112211        $url = $scheme . '://' . $current_site->domain . $current_site->path;
    22122212
     
    22682268 * @return string Admin url link with optional path appended
    22692269*/
    22702270function self_admin_url($path = '', $scheme = 'admin') {
    2271         if ( is_network_admin() )
     2271        if ( in_network_admin() )
    22722272                return network_admin_url($path, $scheme);
    2273         elseif ( is_user_admin() )
     2273        elseif ( in_user_admin() )
    22742274                return user_admin_url($path, $scheme);
    22752275        else
    22762276                return admin_url($path, $scheme);
     
    23262326function get_edit_profile_url( $user, $scheme = 'admin' ) {
    23272327        $user = (int) $user;
    23282328
    2329         if ( is_user_admin() )
     2329        if ( in_user_admin() )
    23302330                $url = user_admin_url( 'profile.php', $scheme );
    2331         elseif ( is_network_admin() )
     2331        elseif ( in_network_admin() )
    23322332                $url = network_admin_url( 'profile.php', $scheme );
    23332333        else
    23342334                $url = get_dashboard_url( $user, 'profile.php', $scheme );
  • wp-includes/general-template.php

     
    21492149        wp_enqueue_script( 'thickbox' );
    21502150        wp_enqueue_style( 'thickbox' );
    21512151
    2152         if ( is_network_admin() )
     2152        if ( in_network_admin() )
    21532153                add_action( 'admin_head', '_thickbox_path_admin_subfolder' );
    21542154}
    21552155
  • wp-includes/canonical.php

     
    3737function redirect_canonical( $requested_url = null, $do_redirect = true ) {
    3838        global $wp_rewrite, $is_iis7, $wp_query, $wpdb;
    3939
    40         if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || !empty($_POST) || is_preview() || is_robots() || ( $is_iis7 && !iis7_supports_permalinks() ) )
     40        if ( is_trackback() || is_search() || is_comments_popup() || in_admin() || !empty($_POST) || is_preview() || is_robots() || ( $is_iis7 && !iis7_supports_permalinks() ) )
    4141                return;
    4242
    4343        if ( !$requested_url ) {
  • wp-includes/class-wp.php

     
    468468        function handle_404() {
    469469                global $wp_query;
    470470
    471                 if ( !is_admin() && ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) {
     471                if ( !in_admin() && ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) {
    472472                        // Don't 404 for these queries if they matched an object.
    473473                        if ( ( is_tag() || is_category() || is_tax() || is_author() ) && $wp_query->get_queried_object() && !is_paged() ) {
    474474                                if ( !is_404() )
  • wp-includes/ms-load.php

     
    226226
    227227        $title = /*WP_I18N_FATAL_ERROR*/'Error establishing database connection'/*/WP_I18N_FATAL_ERROR*/;
    228228        $msg  = '<h1>' . $title . '</h1>';
    229         if ( ! is_admin() )
     229        if ( ! in_admin() )
    230230                die( $msg );
    231231        $msg .= '<p>' . /*WP_I18N_CONTACT_OWNER*/'If your site does not display, please contact the owner of this network.'/*/WP_I18N_CONTACT_OWNER*/ . '';
    232232        $msg .= ' ' . /*WP_I18N_CHECK_MYSQL*/'If you are the owner of this network please check that MySQL is running properly and all tables are error free.'/*/WP_I18N_CHECK_MYSQL*/ . '</p>';
  • wp-includes/deprecated.php

     
    26022602        return true;
    26032603}
    26042604
     2605/**
     2606 * Whether the current request is for a network or blog admin page
     2607 *
     2608 * Originally called is_admin() this was easily confused with is_super_admin()
     2609 * or as a function checking user caps. Replaced with in_admin() since this more
     2610 * accurately reflects what the function is doing.
     2611 *
     2612 * @since 3.1.0
     2613 * @deprecated 3.1.0
     2614 * @deprecated Use in_admin().
     2615 * @see in_admin()
     2616 */
     2617function is_admin() {
     2618        _deprecated_function( __FUNCTION__, '3.1', 'in_admin()' );
     2619
     2620        return in_admin();
     2621}
     2622
     2623/**
     2624 * Checks to see if the current request is inside a blog admin screen /wp-admin/
     2625 * Replaced with in_blog_admin()
     2626 *
     2627 * @deprecated Use in_blog_admin().
     2628 * @see in_blog_admin()
     2629 */
     2630function is_blog_admin() {
     2631        return in_blog_admin();
     2632}
     2633
     2634/**
     2635 * Checks to see if the current request is inside a network admin screen /wp-admin/network/
     2636 * Replaced with in_network_admin()
     2637 *
     2638 * @deprecated Use in_network_admin().
     2639 * @see in_network_admin()
     2640 */
     2641function is_network_admin() {
     2642        return in_network_admin();
     2643}
     2644
     2645/**
     2646 * Checks to see if the current request is inside a user admin screen /wp-admin/user/
     2647 * Replaced with in_user_admin()
     2648 *
     2649 * @deprecated Use in_user_admin().
     2650 * @see in_user_admin()
     2651 */
     2652function is_user_admin() {
     2653        return in_user_admin();
     2654}
     2655 No newline at end of file
  • wp-includes/pluggable.php

     
    8181                return;
    8282
    8383        if ( ! $user = wp_validate_auth_cookie() ) {
    84                  if ( is_blog_admin() || is_network_admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) {
     84                 if ( in_blog_admin() || in_network_admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) {
    8585                        wp_set_current_user(0);
    8686                        return false;
    8787                 }
     
    780780                }
    781781        }
    782782
    783         if ( is_user_admin() )
     783        if ( in_user_admin() )
    784784                $scheme = 'logged_in';
    785785        else
    786786                $scheme = apply_filters( 'auth_redirect_scheme', '' );
  • wp-includes/widgets.php

     
    999999
    10001000        // If loading from front page, consult $_wp_sidebars_widgets rather than options
    10011001        // to see if wp_convert_widget_settings() has made manipulations in memory.
    1002         if ( !is_admin() ) {
     1002        if ( !in_admin() ) {
    10031003                if ( empty($_wp_sidebars_widgets) )
    10041004                        $_wp_sidebars_widgets = get_option('sidebars_widgets', array());
    10051005
     
    11471147                $settings = array( 2 => $settings );
    11481148
    11491149                // If loading from the front page, update sidebar in memory but don't save to options
    1150                 if ( is_admin() ) {
     1150                if ( in_admin() ) {
    11511151                        $sidebars_widgets = get_option('sidebars_widgets');
    11521152                } else {
    11531153                        if ( empty($GLOBALS['_wp_sidebars_widgets']) )
     
    11671167                        }
    11681168                }
    11691169
    1170                 if ( is_admin() && $changed )
     1170                if ( in_admin() && $changed )
    11711171                        update_option('sidebars_widgets', $sidebars_widgets);
    11721172        }
    11731173
    11741174        $settings['_multiwidget'] = 1;
    1175         if ( is_admin() )
     1175        if ( in_admin() )
    11761176                update_option( $option_name, $settings );
    11771177
    11781178        return $settings;
  • wp-includes/script-loader.php

     
    276276
    277277        $scripts->add( 'wpdialogs-popup', "/wp-includes/js/tinymce/plugins/wpdialogs/js/popup$suffix.js", array( 'jquery-ui-dialog' ), '20101119' );
    278278
    279         if ( is_admin() ) {
     279        if ( in_admin() ) {
    280280                $scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ), '20090102' );
    281281                $scripts->add_data( 'ajaxcat', 'group', 1 );
    282282                $scripts->localize( 'ajaxcat', 'catL10n', array(
     
    768768
    769769        if ( ! isset($concatenate_scripts) ) {
    770770                $concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;
    771                 if ( ! is_admin() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) )
     771                if ( ! in_admin() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) )
    772772                        $concatenate_scripts = false;
    773773        }
    774774
  • wp-includes/class-wp-admin-bar.php

     
    185185                add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 );
    186186                add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
    187187
    188                 if ( !is_network_admin() && !is_user_admin() ) {
     188                if ( !in_network_admin() && !in_user_admin() ) {
    189189                        add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 40 );
    190190                        add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 );
    191191                        add_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 60 );
  • wp-admin/network.php

     
    1919        wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
    2020
    2121if ( is_multisite() ) {
    22         if ( ! is_network_admin() ) {
     22        if ( ! in_network_admin() ) {
    2323                wp_redirect( network_admin_url( 'setup.php' ) );
    2424                exit;
    2525        }
     
    9595if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) )
    9696        wp_die( __( 'You must define the <code>WP_ALLOW_MULTISITE</code> constant as true in your wp-config.php file to allow creation of a Network.' ) );
    9797
    98 if ( is_network_admin() ) {
     98if ( in_network_admin() ) {
    9999        $title = __( 'Network Setup' );
    100100        $parent_file = 'settings.php';
    101101} else {
  • wp-admin/includes/menu.php

     
    77 * @subpackage Administration
    88 */
    99
    10 if ( is_network_admin() )
     10if ( in_network_admin() )
    1111        do_action('_network_admin_menu');
    12 elseif ( is_user_admin() )
     12elseif ( in_user_admin() )
    1313        do_action('_user_admin_menu');
    1414else
    1515        do_action('_admin_menu');
     
    8989}
    9090unset($id, $data, $subs, $first_sub, $old_parent, $new_parent);
    9191
    92 if ( is_network_admin() )
     92if ( in_network_admin() )
    9393        do_action('network_admin_menu', '');
    94 elseif ( is_user_admin() )
     94elseif ( in_user_admin() )
    9595        do_action('user_admin_menu', '');
    9696else
    9797        do_action('admin_menu', '');
  • wp-admin/includes/update.php

     
    196196
    197197        $wp_list_table = _get_list_table('WP_Plugins_List_Table');
    198198
    199         if ( is_network_admin() || !is_multisite() ) {
     199        if ( in_network_admin() || !is_multisite() ) {
    200200                echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
    201201                if ( ! current_user_can('update_plugins') )
    202202                        printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
  • wp-admin/includes/dashboard.php

     
    2626        /* Register Widgets and Controls */
    2727
    2828        // Right Now
    29         if ( is_blog_admin() && current_user_can('edit_posts') )
     29        if ( in_blog_admin() && current_user_can('edit_posts') )
    3030                wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );
    3131
    32         if ( is_network_admin() )
     32        if ( in_network_admin() )
    3333                wp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_dashboard_right_now' );
    3434
    3535        // Recent Comments Widget
    36         if ( is_blog_admin() && current_user_can('moderate_comments') ) {
     36        if ( in_blog_admin() && current_user_can('moderate_comments') ) {
    3737                if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) {
    3838                        $update = true;
    3939                        $widget_options['dashboard_recent_comments'] = array(
     
    4545        }
    4646
    4747        // Incoming Links Widget
    48         if ( is_blog_admin() && current_user_can('publish_posts') ) {
     48        if ( in_blog_admin() && current_user_can('publish_posts') ) {
    4949                if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
    5050                        $update = true;
    5151                        $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
     
    6161        }
    6262
    6363        // WP Plugins Widget
    64         if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) )
     64        if ( ( ! is_multisite() && in_blog_admin() && current_user_can( 'install_plugins' ) ) || ( in_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) )
    6565                wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
    6666
    6767        // QuickPress Widget
    68         if ( is_blog_admin() && current_user_can('edit_posts') )
     68        if ( in_blog_admin() && current_user_can('edit_posts') )
    6969                wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
    7070
    7171        // Recent Drafts
    72         if ( is_blog_admin() && current_user_can('edit_posts') )
     72        if ( in_blog_admin() && current_user_can('edit_posts') )
    7373                wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );
    7474
    7575        // Primary feed (Dev Blog) Widget
     
    104104
    105105        // Hook to register new widgets
    106106        // Filter widget order
    107         if ( is_network_admin() ) {
     107        if ( in_network_admin() ) {
    108108                do_action( 'wp_network_dashboard_setup' );
    109109                $dashboard_widgets = apply_filters( 'wp_network_dashboard_widgets', array() );
    110         } elseif ( is_user_admin() ) {
     110        } elseif ( in_user_admin() ) {
    111111                do_action( 'wp_user_dashboard_setup' );
    112112                $dashboard_widgets = apply_filters( 'wp_user_dashboard_widgets', array() );
    113113        } else {
     
    153153
    154154        if ( is_blog_admin () )
    155155                $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');
    156         else if (is_network_admin() )
     156        else if (in_network_admin() )
    157157                $side_widgets = array('dashboard_primary', 'dashboard_secondary');
    158158        else
    159159                $side_widgets = array();
     
    781781        $rss = fetch_feed( $url );
    782782
    783783        if ( is_wp_error($rss) ) {
    784                 if ( is_admin() || current_user_can('manage_options') ) {
     784                if ( in_admin() || current_user_can('manage_options') ) {
    785785                        echo '<p>';
    786786                        printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());
    787787                        echo '</p>';
     
    897897        $rss = @fetch_feed( $url );
    898898
    899899        if ( is_wp_error($rss) ) {
    900                 if ( is_admin() || current_user_can('manage_options') ) {
     900                if ( in_admin() || current_user_can('manage_options') ) {
    901901                        echo '<div class="rss-widget"><p>';
    902902                        printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());
    903903                        echo '</p></div>';
  • wp-admin/includes/class-wp-upgrader.php

     
    13621362                else
    13631363                        $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
    13641364
    1365                 if ( ! $this->result || is_wp_error($this->result) || is_network_admin() )
     1365                if ( ! $this->result || is_wp_error($this->result) || in_network_admin() )
    13661366                        unset( $install_actions['activate'], $install_actions['preview'] );
    13671367
    13681368                $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info);
  • wp-admin/includes/theme-install.php

     
    141141                $actions = array();
    142142                $actions[] = '<a href="' . self_admin_url('theme-install.php?tab=theme-information&amp;theme=' . $theme->slug .
    143143                                                                                '&amp;TB_iframe=true&amp;tbWidth=500&amp;tbHeight=385') . '" class="thickbox thickbox-preview onclick" title="' . esc_attr(sprintf(__('Install &#8220;%s&#8221;'), $name)) . '">' . __('Install') . '</a>';
    144                 if ( !is_network_admin() )
     144                if ( !in_network_admin() )
    145145                        $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>';
    146146                $actions = apply_filters('theme_install_action_links', $actions, $theme);
    147147        }
  • wp-admin/includes/template.php

     
    16621662function convert_to_screen( $screen ) {
    16631663        $screen = str_replace( array('.php', '-new', '-add', '-network', '-user' ), '', $screen);
    16641664
    1665         if ( is_network_admin() )
     1665        if ( in_network_admin() )
    16661666                $screen .= '-network';
    1667         elseif ( is_user_admin() )
     1667        elseif ( in_user_admin() )
    16681668                $screen .= '-user';
    16691669
    16701670        $screen = (string) apply_filters( 'screen_meta_screen', $screen );
     
    20942094                $current_screen->taxonomy = $taxnow;
    20952095        }
    20962096
    2097         $current_screen->is_network = is_network_admin();
    2098         $current_screen->is_user = is_user_admin();
     2097        $current_screen->is_network = in_network_admin();
     2098        $current_screen->is_user = in_user_admin();
    20992099
    21002100        if ( $current_screen->is_network ) {
    21012101                $current_screen->base .= '-network';
  • wp-admin/theme-editor.php

     
    99/** WordPress Administration Bootstrap */
    1010require_once('./admin.php');
    1111
    12 if ( is_multisite() && ! is_network_admin() ) {
     12if ( is_multisite() && ! in_network_admin() ) {
    1313        wp_redirect( network_admin_url( 'theme-editor.php' ) );
    1414        exit();
    1515}
     
    2626$help .= '<p>' . __('After typing in your edits, click Update File.') . '</p>';
    2727$help .= '<p>' . __('<strong>Advice:</strong> think very carefully about your site crashing if you are live-editing the theme currently in use.') . '</p>';
    2828$help .= '<p>' . __('Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a <a href="http://codex.wordpress.org/Child_Themes" target="_blank">child theme</a> instead.') . '</p>';
    29 if ( is_network_admin() )
     29if ( in_network_admin() )
    3030        $help .= '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>';
    3131$help .= '<p><strong>' . __('For more information:') . '</strong></p>';
    3232$help .= '<p>' . __('<a href="http://codex.wordpress.org/Theme_Development" target="_blank">Documentation on Theme Development</a>') . '</p>';
  • wp-admin/load-styles.php

     
    6565/**
    6666 * @ignore
    6767 */
    68 function is_admin() {return true;}
     68function in_admin() {return true;}
    6969
    7070/**
    7171 * @ignore
  • wp-admin/index.php

     
    2424$title = __('Dashboard');
    2525$parent_file = 'index.php';
    2626
    27 if ( is_user_admin() )
     27if ( in_user_admin() )
    2828        add_screen_option('layout_columns', array('max' => 4, 'default' => 1) );
    2929else
    3030        add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
  • wp-admin/plugin-install.php

     
    1515if ( ! current_user_can('install_plugins') )
    1616        wp_die(__('You do not have sufficient permissions to install plugins on this site.'));
    1717
    18 if ( is_multisite() && ! is_network_admin() ) {
     18if ( is_multisite() && ! in_network_admin() ) {
    1919        wp_redirect( network_admin_url( 'plugin-install.php' ) );
    2020        exit();
    2121}
  • wp-admin/load-scripts.php

     
    6565/**
    6666 * @ignore
    6767 */
    68 function is_admin() {return true;}
     68function in_admin() {return true;}
    6969
    7070/**
    7171 * @ignore
  • wp-admin/admin-header.php

     
    1313get_admin_page_title();
    1414$title = esc_html( strip_tags( $title ) );
    1515
    16 if ( is_network_admin() )
     16if ( in_network_admin() )
    1717        $admin_title = __( 'Network Admin' );
    18 elseif ( is_user_admin() )
     18elseif ( in_user_admin() )
    1919        $admin_title = __( 'Global Dashboard' );
    2020else
    2121        $admin_title = get_bloginfo( 'name' );
     
    107107<div id="wphead">
    108108<?php
    109109
    110 if ( is_network_admin() )
     110if ( in_network_admin() )
    111111        $blog_name = sprintf( __('%s Network Admin'), esc_html($current_site->site_name) );
    112 elseif ( is_user_admin() )
     112elseif ( in_user_admin() )
    113113        $blog_name = sprintf( __('%s Global Dashboard'), esc_html($current_site->site_name) );
    114114else
    115115        $blog_name = get_bloginfo('name', 'display');
     
    137137        <a href="<?php echo trailingslashit( get_bloginfo( 'url' ) ); ?>" title="<?php esc_attr_e('Visit Site') ?>">
    138138                <span id="site-title"><?php echo $blog_name ?></span>
    139139        </a>
    140 <?php if ( !is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public') ): ?>
     140<?php if ( !in_network_admin() && !in_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public') ): ?>
    141141        <a id="privacy-on-link" href="options-privacy.php" title="<?php echo esc_attr( apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content') ) ); ?>"><?php echo apply_filters('privacy_on_link_text', __('Search Engines Blocked') ); ?></a>
    142142<?php endif; ?>
    143143</h1>
     
    150150$links = array();
    151151$links[5] = sprintf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity);
    152152if ( is_multisite() && is_super_admin() ) {
    153         if ( !is_network_admin() )
     153        if ( !in_network_admin() )
    154154                $links[10] = '| <a href="' . network_admin_url() . '" title="' . ( ! empty( $update_title ) ? $update_title : esc_attr__('Network Admin') ) . '">' . __('Network Admin') . ( ! empty( $total_update_count ) ? ' (' . number_format_i18n( $total_update_count ) . ')' : '' ) . '</a>';
    155155        else
    156156                $links[10] = '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
     
    183183<?php
    184184screen_meta($current_screen);
    185185
    186 if ( is_network_admin() )
     186if ( in_network_admin() )
    187187        do_action('network_admin_notices');
    188 elseif ( is_user_admin() )
     188elseif ( in_user_admin() )
    189189        do_action('user_admin_notices');
    190190else
    191191        do_action('admin_notices');
  • wp-admin/plugins.php

     
    249249                                        $plugins_to_delete = count( $plugin_info );
    250250                                        echo '<h2>' . _n( 'Delete Plugin', 'Delete Plugins', $plugins_to_delete ) . '</h2>';
    251251                                ?>
    252                                 <?php if ( $have_non_network_plugins && is_network_admin() ) : ?>
     252                                <?php if ( $have_non_network_plugins && in_network_admin() ) : ?>
    253253                                <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo _n( 'This plugin may be active on other sites in the network.', 'These plugins may be active on other sites in the network.', $plugins_to_delete ); ?></p></div>
    254254                                <?php endif; ?>
    255255                                <p><?php echo _n( 'You are about to remove the following plugin:', 'You are about to remove the following plugins:', $plugins_to_delete ); ?></p>
     
    389389<div class="wrap">
    390390<?php screen_icon(); ?>
    391391<h2><?php echo esc_html( $title );
    392 if ( ( ! is_multisite() || is_network_admin() ) && current_user_can('install_plugins') ) { ?>
     392if ( ( ! is_multisite() || in_network_admin() ) && current_user_can('install_plugins') ) { ?>
    393393<a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="button add-new-h2"><?php echo esc_html_x('Add New', 'plugin'); ?></a>
    394394<?php }
    395395if ( $s )
  • wp-admin/user-edit.php

     
    3131else
    3232        $submenu_file = 'profile.php';
    3333
    34 if ( current_user_can('edit_users') && !is_user_admin() )
     34if ( current_user_can('edit_users') && !in_user_admin() )
    3535        $parent_file = 'users.php';
    3636else
    3737        $parent_file = 'profile.php';
     
    123123        $blog_prefix = $wpdb->get_blog_prefix();
    124124        if ( $user_id != $current_user->ID ) {
    125125                $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'" );
    126                 if ( !is_network_admin() && null == $cap && $_POST[ 'role' ] == '' ) {
     126                if ( !in_network_admin() && null == $cap && $_POST[ 'role' ] == '' ) {
    127127                        $_POST[ 'role' ] = 'contributor';
    128128                        $delete_role = true;
    129129                }
     
    133133        if ( $delete_role ) // stops users being added to current blog when they are edited
    134134                delete_user_meta( $user_id, $blog_prefix . 'capabilities' );
    135135
    136         if ( is_multisite() && is_network_admin() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) )
     136        if ( is_multisite() && in_network_admin() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) )
    137137                empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
    138138}
    139139
     
    231231                <td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr($profileuser->user_login); ?>" disabled="disabled" class="regular-text" /> <span class="description"><?php _e('Usernames cannot be changed.'); ?></span></td>
    232232        </tr>
    233233
    234 <?php if ( !IS_PROFILE_PAGE && !is_network_admin() ) : ?>
     234<?php if ( !IS_PROFILE_PAGE && !in_network_admin() ) : ?>
    235235<tr><th><label for="role"><?php _e('Role:') ?></label></th>
    236236<td><select name="role" id="role">
    237237<?php
     
    252252</select>
    253253<?php endif; //!IS_PROFILE_PAGE
    254254
    255 if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>
     255if ( is_multisite() && in_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>
    256256<tr><th><label for="role"><?php _e('Super Admin'); ?></label></th>
    257257<td>
    258258<?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) ) : ?>
  • wp-admin/theme-install.php

     
    1515if ( ! current_user_can('install_themes') )
    1616        wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
    1717
    18 if ( is_multisite() && ! is_network_admin() ) {
     18if ( is_multisite() && ! in_network_admin() ) {
    1919        wp_redirect( network_admin_url( 'theme-install.php' ) );
    2020        exit();
    2121}
     
    3131
    3232$title = __('Install Themes');
    3333$parent_file = 'themes.php';
    34 if ( !is_network_admin() )
     34if ( !in_network_admin() )
    3535        $submenu_file = 'themes.php';
    3636
    3737wp_enqueue_style( 'theme-install' );
     
    5858<?php
    5959screen_icon();
    6060
    61 if ( is_network_admin() ) : ?>
     61if ( in_network_admin() ) : ?>
    6262<h2><?php echo esc_html( $title ); ?></h2>
    6363<?php else : ?>
    6464<h2 class="nav-tab-wrapper"><a href="themes.php" class="nav-tab"><?php echo esc_html_x('Manage Themes', 'theme'); ?></a><a href="theme-install.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a></h2>
  • wp-admin/update-core.php

     
    99/** WordPress Administration Bootstrap */
    1010require_once('./admin.php');
    1111
    12 if ( is_multisite() && ! is_network_admin() ) {
     12if ( is_multisite() && ! in_network_admin() ) {
    1313        wp_redirect( network_admin_url( 'update-core.php' ) );
    1414        exit();
    1515}
  • wp-admin/plugin-editor.php

     
    99/** WordPress Administration Bootstrap */
    1010require_once('./admin.php');
    1111
    12 if ( is_multisite() && ! is_network_admin() ) {
     12if ( is_multisite() && ! in_network_admin() ) {
    1313        wp_redirect( network_admin_url( 'plugin-editor.php' ) );
    1414        exit();
    1515}
     
    117117                '<p>' . __('Choose a plugin to edit from the menu in the upper right and click the Select button. Click once on any file name to load it in the editor, and make your changes. Don&#8217;t forget to save your changes (Update File) when you&#8217;re finished.') . '</p>' .
    118118                '<p>' . __('The Documentation menu below the editor lists the PHP functions recognized in the plugin file. Clicking Lookup takes you to a web page about that particular function.') . '</p>' .
    119119                '<p>' . __('If you want to make changes but don&#8217;t want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit plugins, write your own from scratch, or just better understand their anatomy, check out the links below.') . '</p>' .
    120                 ( is_network_admin() ? '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>' : '' ) .
     120                ( in_network_admin() ? '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>' : '' ) .
    121121                '<p><strong>' . __('For more information:') . '</strong></p>' .
    122122                '<p>' . __('<a href="http://codex.wordpress.org/Plugins_Editor_SubPanel" target="_blank">Documentation on Editing Plugins</a>') . '</p>' .
    123123                '<p>' . __('<a href="http://codex.wordpress.org/Writing_a_Plugin" target="_blank">Documentation on Writing Plugins</a>') . '</p>' .