Ticket #16490: in_admin_inc_deprecated.patch
File in_admin_inc_deprecated.patch, 42.1 KB (added by , 13 years ago) |
---|
-
wp-includes/admin-bar.php
347 347 if ( ! is_user_logged_in() ) { 348 348 $show_admin_bar = false; 349 349 } else { 350 $context = i s_admin() ? 'admin' : 'front';350 $context = in_admin() ? 'admin' : 'front'; 351 351 $show_admin_bar = _get_admin_bar_pref( $context ); 352 352 } 353 353 } -
wp-includes/default-filters.php
21 21 22 22 // Strip, kses, special chars for string display 23 23 foreach ( 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 ( i s_admin() ) {24 if ( in_admin() ) { 25 25 // These are expensive. Run only on admin pages for defense in depth. 26 26 add_filter( $filter, 'sanitize_text_field' ); 27 27 add_filter( $filter, 'wp_kses_data' ); … … 35 35 } 36 36 37 37 // Kses only for textarea admin displays 38 if ( i s_admin() ) {38 if ( in_admin() ) { 39 39 foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description', 'comment_text' ) as $filter ) { 40 40 add_filter( $filter, 'wp_kses_data' ); 41 41 } … … 51 51 // Email admin display 52 52 foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) { 53 53 add_filter( $filter, 'sanitize_email' ); 54 if ( i s_admin() )54 if ( in_admin() ) 55 55 add_filter( $filter, 'wp_kses_data' ); 56 56 } 57 57 … … 65 65 66 66 // Display URL 67 67 foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url' ) as $filter ) { 68 if ( i s_admin() )68 if ( in_admin() ) 69 69 add_filter( $filter, 'wp_strip_all_tags' ); 70 70 add_filter( $filter, 'esc_url' ); 71 if ( i s_admin() )71 if ( in_admin() ) 72 72 add_filter( $filter, 'wp_kses_data' ); 73 73 } 74 74 -
wp-includes/post-template.php
107 107 $title = isset($post->post_title) ? $post->post_title : ''; 108 108 $id = isset($post->ID) ? $post->ID : (int) $id; 109 109 110 if ( !i s_admin() ) {110 if ( !in_admin() ) { 111 111 if ( !empty($post->post_password) ) { 112 112 $protected_title_format = apply_filters('protected_title_format', __('Protected: %s')); 113 113 $title = sprintf($protected_title_format, $title); -
wp-includes/default-widgets.php
103 103 $show_images = isset($instance['images']) ? $instance['images'] : true; 104 104 $category = isset($instance['category']) ? $instance['category'] : false; 105 105 106 if ( i s_admin() && !$category ) {106 if ( in_admin() && !$category ) { 107 107 // Display All Links widget as such in the widgets screen 108 108 echo $before_widget . $before_title. __('All Links') . $after_title . $after_widget; 109 109 return; … … 784 784 } 785 785 786 786 if ( is_wp_error($rss) ) { 787 if ( i s_admin() || current_user_can('manage_options') )787 if ( in_admin() || current_user_can('manage_options') ) 788 788 echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>'; 789 789 return; 790 790 } -
wp-includes/theme.php
1254 1254 } 1255 1255 delete_option('current_theme'); 1256 1256 $theme = get_current_theme(); 1257 if ( i s_admin() && false === get_option( "theme_mods_$stylesheet" ) ) {1257 if ( in_admin() && false === get_option( "theme_mods_$stylesheet" ) ) { 1258 1258 $default_theme_mods = (array) get_option( "mods_$theme" ); 1259 1259 add_option( "theme_mods_$stylesheet", $default_theme_mods ); 1260 1260 } … … 1309 1309 if ( false === ( $mods = get_option( "theme_mods_$theme_slug" ) ) ) { 1310 1310 $theme_name = get_current_theme(); 1311 1311 $mods = get_option( "mods_$theme_name" ); // Deprecated location. 1312 if ( i s_admin() && false !== $mods ) {1312 if ( in_admin() && false !== $mods ) { 1313 1313 update_option( "theme_mods_$theme_slug", $mods ); 1314 1314 delete_option( "mods_$theme_name" ); 1315 1315 } … … 1469 1469 add_theme_support( 'custom-header', array( 'callback' => $header_callback ) ); 1470 1470 add_theme_support( 'custom-header-uploads' ); 1471 1471 1472 if ( ! i s_admin() )1472 if ( ! in_admin() ) 1473 1473 return; 1474 1474 1475 1475 global $custom_image_header; … … 1496 1496 _remove_theme_support( 'custom-header' ); 1497 1497 remove_theme_support( 'custom-header-uploads' ); 1498 1498 1499 if ( i s_admin() ) {1499 if ( in_admin() ) { 1500 1500 remove_action( 'admin_menu', array( &$GLOBALS['custom_image_header'], 'init' ) ); 1501 1501 unset( $GLOBALS['custom_image_header'] ); 1502 1502 } … … 1612 1612 1613 1613 add_theme_support( 'custom-background', array( 'callback' => $header_callback ) ); 1614 1614 1615 if ( ! i s_admin() )1615 if ( ! in_admin() ) 1616 1616 return; 1617 1617 require_once( ABSPATH . 'wp-admin/custom-background.php' ); 1618 1618 $GLOBALS['custom_background'] =& new Custom_Background( $admin_header_callback, $admin_image_div_callback ); … … 1635 1635 remove_action( 'wp_head', $callback[0]['callback'] ); 1636 1636 _remove_theme_support( 'custom-background' ); 1637 1637 1638 if ( i s_admin() ) {1638 if ( in_admin() ) { 1639 1639 remove_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) ); 1640 1640 unset( $GLOBALS['custom_background'] ); 1641 1641 } … … 1705 1705 1706 1706 add_theme_support( 'editor-style' ); 1707 1707 1708 if ( ! i s_admin() )1708 if ( ! in_admin() ) 1709 1709 return; 1710 1710 1711 1711 global $editor_styles; … … 1730 1730 if ( ! current_theme_supports( 'editor-style' ) ) 1731 1731 return false; 1732 1732 _remove_theme_support( 'editor-style' ); 1733 if ( i s_admin() )1733 if ( in_admin() ) 1734 1734 $GLOBALS['editor_styles'] = array(); 1735 1735 return true; 1736 1736 } -
wp-includes/functions.php
819 819 */ 820 820 function wp_user_settings() { 821 821 822 if ( ! i s_admin() )822 if ( ! in_admin() ) 823 823 return; 824 824 825 825 if ( defined('DOING_AJAX') ) -
wp-includes/vars.php
13 13 */ 14 14 15 15 // On which page are we ? 16 if ( i s_admin() ) {16 if ( in_admin() ) { 17 17 // wp-admin pages are checked more carefully 18 if ( i s_network_admin() )18 if ( in_network_admin() ) 19 19 preg_match('#/wp-admin/network/?(.*?)$#i', $PHP_SELF, $self_matches); 20 elseif ( i s_user_admin() )20 elseif ( in_user_admin() ) 21 21 preg_match('#/wp-admin/user/?(.*?)$#i', $PHP_SELF, $self_matches); 22 22 else 23 23 preg_match('#/wp-admin/?(.*?)$#i', $PHP_SELF, $self_matches); -
wp-includes/load.php
570 570 } 571 571 572 572 /** 573 * Whether the current request is for a network or blog admin page573 * Checks to see if the current request is inside any type of WordPress administration page. /wp-admin/* 574 574 * 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 577 576 * 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. 581 578 */ 582 function i s_admin() {579 function in_admin() { 583 580 if ( defined( 'WP_ADMIN' ) ) 584 581 return WP_ADMIN; 585 582 return false; 586 583 } 587 584 588 585 /** 589 * Whether the current request is fora blog admin screen /wp-admin/586 * Checks to see if the current request is inside a blog admin screen /wp-admin/ 590 587 * 591 * Does not inform on whether the user is a blog admin! Use capability checks to592 * tell if the user should be accessing a section or not.593 *594 588 * @since 3.1.0 595 589 * 596 * @return bool True if inside WordPress networkadministration pages.590 * @return bool True if inside WordPress blog administration pages. 597 591 */ 598 function i s_blog_admin() {592 function in_blog_admin() { 599 593 if ( defined( 'WP_BLOG_ADMIN' ) ) 600 594 return WP_BLOG_ADMIN; 601 595 return false; 602 596 } 603 597 604 598 /** 605 * Whether the current request is fora network admin screen /wp-admin/network/599 * Checks to see if the current request is inside a network admin screen /wp-admin/network/ 606 600 * 607 * Does not inform on whether the user is a network admin! Use capability checks to608 * tell if the user should be accessing a section or not.609 *610 601 * @since 3.1.0 611 602 * 612 603 * @return bool True if inside WordPress network administration pages. 613 604 */ 614 function i s_network_admin() {605 function in_network_admin() { 615 606 if ( defined( 'WP_NETWORK_ADMIN' ) ) 616 607 return WP_NETWORK_ADMIN; 617 608 return false; 618 609 } 619 610 620 611 /** 621 * Whether the current request is fora user admin screen /wp-admin/user/612 * Checks to see if the current request is inside a user admin screen /wp-admin/user/ 622 613 * 623 * Does not inform on whether the user is an admin! Use capability checks to624 * tell if the user should be accessing a section or not.625 *626 614 * @since 3.1.0 627 615 * 628 616 * @return bool True if inside WordPress user administration pages. 629 617 */ 630 function i s_user_admin() {618 function in_user_admin() { 631 619 if ( defined( 'WP_USER_ADMIN' ) ) 632 620 return WP_USER_ADMIN; 633 621 return false; -
wp-includes/media.php
64 64 } elseif ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ) ) ) { 65 65 $max_width = intval( $_wp_additional_image_sizes[$size]['width'] ); 66 66 $max_height = intval( $_wp_additional_image_sizes[$size]['height'] ); 67 if ( intval($content_width) > 0 && i s_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. 68 68 $max_width = min( intval($content_width), $max_width ); 69 69 } 70 70 // $size == 'full' has no constraint -
wp-includes/query.php
1550 1550 if ( '' != $qv['preview'] ) 1551 1551 $this->is_preview = true; 1552 1552 1553 if ( i s_admin() )1553 if ( in_admin() ) 1554 1554 $this->is_admin = true; 1555 1555 1556 1556 if ( false !== strpos($qv['feed'], 'comments-') ) { … … 2419 2419 $where .= " OR $wpdb->posts.post_status = '$state'"; 2420 2420 } 2421 2421 2422 if ( i s_admin() ) {2422 if ( in_admin() ) { 2423 2423 // Add protected states that should show in the admin all list. 2424 2424 $admin_all_states = get_post_stati( array('protected' => true, 'show_in_admin_all_list' => true) ); 2425 2425 foreach ( (array) $admin_all_states as $state ) -
wp-includes/link-template.php
1489 1489 $request = preg_replace('|^'. $home_root . '|', '', $request); 1490 1490 $request = preg_replace('|^/+|', '', $request); 1491 1491 1492 if ( !$wp_rewrite->using_permalinks() || i s_admin() ) {1492 if ( !$wp_rewrite->using_permalinks() || in_admin() ) { 1493 1493 $base = trailingslashit( get_bloginfo( 'url' ) ); 1494 1494 1495 1495 if ( $pagenum > 1 ) { … … 1953 1953 $orig_scheme = $scheme; 1954 1954 1955 1955 if ( !in_array( $scheme, array( 'http', 'https' ) ) ) 1956 $scheme = is_ssl() && !i s_admin() ? 'https' : 'http';1956 $scheme = is_ssl() && !in_admin() ? 'https' : 'http'; 1957 1957 1958 1958 if ( empty( $blog_id ) || !is_multisite() ) 1959 1959 $url = get_option( 'home' ); … … 2206 2206 $orig_scheme = $scheme; 2207 2207 2208 2208 if ( !in_array($scheme, array('http', 'https')) ) 2209 $scheme = is_ssl() && !i s_admin() ? 'https' : 'http';2209 $scheme = is_ssl() && !in_admin() ? 'https' : 'http'; 2210 2210 2211 2211 $url = $scheme . '://' . $current_site->domain . $current_site->path; 2212 2212 … … 2268 2268 * @return string Admin url link with optional path appended 2269 2269 */ 2270 2270 function self_admin_url($path = '', $scheme = 'admin') { 2271 if ( i s_network_admin() )2271 if ( in_network_admin() ) 2272 2272 return network_admin_url($path, $scheme); 2273 elseif ( i s_user_admin() )2273 elseif ( in_user_admin() ) 2274 2274 return user_admin_url($path, $scheme); 2275 2275 else 2276 2276 return admin_url($path, $scheme); … … 2326 2326 function get_edit_profile_url( $user, $scheme = 'admin' ) { 2327 2327 $user = (int) $user; 2328 2328 2329 if ( i s_user_admin() )2329 if ( in_user_admin() ) 2330 2330 $url = user_admin_url( 'profile.php', $scheme ); 2331 elseif ( i s_network_admin() )2331 elseif ( in_network_admin() ) 2332 2332 $url = network_admin_url( 'profile.php', $scheme ); 2333 2333 else 2334 2334 $url = get_dashboard_url( $user, 'profile.php', $scheme ); -
wp-includes/general-template.php
2149 2149 wp_enqueue_script( 'thickbox' ); 2150 2150 wp_enqueue_style( 'thickbox' ); 2151 2151 2152 if ( i s_network_admin() )2152 if ( in_network_admin() ) 2153 2153 add_action( 'admin_head', '_thickbox_path_admin_subfolder' ); 2154 2154 } 2155 2155 -
wp-includes/canonical.php
37 37 function redirect_canonical( $requested_url = null, $do_redirect = true ) { 38 38 global $wp_rewrite, $is_iis7, $wp_query, $wpdb; 39 39 40 if ( is_trackback() || is_search() || is_comments_popup() || i s_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() ) ) 41 41 return; 42 42 43 43 if ( !$requested_url ) { -
wp-includes/class-wp.php
468 468 function handle_404() { 469 469 global $wp_query; 470 470 471 if ( !i s_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() ) { 472 472 // Don't 404 for these queries if they matched an object. 473 473 if ( ( is_tag() || is_category() || is_tax() || is_author() ) && $wp_query->get_queried_object() && !is_paged() ) { 474 474 if ( !is_404() ) -
wp-includes/ms-load.php
226 226 227 227 $title = /*WP_I18N_FATAL_ERROR*/'Error establishing database connection'/*/WP_I18N_FATAL_ERROR*/; 228 228 $msg = '<h1>' . $title . '</h1>'; 229 if ( ! i s_admin() )229 if ( ! in_admin() ) 230 230 die( $msg ); 231 231 $msg .= '<p>' . /*WP_I18N_CONTACT_OWNER*/'If your site does not display, please contact the owner of this network.'/*/WP_I18N_CONTACT_OWNER*/ . ''; 232 232 $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
2602 2602 return true; 2603 2603 } 2604 2604 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 */ 2617 function 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 */ 2630 function 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 */ 2641 function 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 */ 2652 function is_user_admin() { 2653 return in_user_admin(); 2654 } 2655 No newline at end of file -
wp-includes/pluggable.php
81 81 return; 82 82 83 83 if ( ! $user = wp_validate_auth_cookie() ) { 84 if ( i s_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') ) { 85 85 wp_set_current_user(0); 86 86 return false; 87 87 } … … 780 780 } 781 781 } 782 782 783 if ( i s_user_admin() )783 if ( in_user_admin() ) 784 784 $scheme = 'logged_in'; 785 785 else 786 786 $scheme = apply_filters( 'auth_redirect_scheme', '' ); -
wp-includes/widgets.php
999 999 1000 1000 // If loading from front page, consult $_wp_sidebars_widgets rather than options 1001 1001 // to see if wp_convert_widget_settings() has made manipulations in memory. 1002 if ( !i s_admin() ) {1002 if ( !in_admin() ) { 1003 1003 if ( empty($_wp_sidebars_widgets) ) 1004 1004 $_wp_sidebars_widgets = get_option('sidebars_widgets', array()); 1005 1005 … … 1147 1147 $settings = array( 2 => $settings ); 1148 1148 1149 1149 // If loading from the front page, update sidebar in memory but don't save to options 1150 if ( i s_admin() ) {1150 if ( in_admin() ) { 1151 1151 $sidebars_widgets = get_option('sidebars_widgets'); 1152 1152 } else { 1153 1153 if ( empty($GLOBALS['_wp_sidebars_widgets']) ) … … 1167 1167 } 1168 1168 } 1169 1169 1170 if ( i s_admin() && $changed )1170 if ( in_admin() && $changed ) 1171 1171 update_option('sidebars_widgets', $sidebars_widgets); 1172 1172 } 1173 1173 1174 1174 $settings['_multiwidget'] = 1; 1175 if ( i s_admin() )1175 if ( in_admin() ) 1176 1176 update_option( $option_name, $settings ); 1177 1177 1178 1178 return $settings; -
wp-includes/script-loader.php
276 276 277 277 $scripts->add( 'wpdialogs-popup', "/wp-includes/js/tinymce/plugins/wpdialogs/js/popup$suffix.js", array( 'jquery-ui-dialog' ), '20101119' ); 278 278 279 if ( i s_admin() ) {279 if ( in_admin() ) { 280 280 $scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ), '20090102' ); 281 281 $scripts->add_data( 'ajaxcat', 'group', 1 ); 282 282 $scripts->localize( 'ajaxcat', 'catL10n', array( … … 768 768 769 769 if ( ! isset($concatenate_scripts) ) { 770 770 $concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true; 771 if ( ! i s_admin() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) )771 if ( ! in_admin() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ) 772 772 $concatenate_scripts = false; 773 773 } 774 774 -
wp-includes/class-wp-admin-bar.php
185 185 add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 ); 186 186 add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 ); 187 187 188 if ( !i s_network_admin() && !is_user_admin() ) {188 if ( !in_network_admin() && !in_user_admin() ) { 189 189 add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 40 ); 190 190 add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 ); 191 191 add_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 60 ); -
wp-admin/network.php
19 19 wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); 20 20 21 21 if ( is_multisite() ) { 22 if ( ! i s_network_admin() ) {22 if ( ! in_network_admin() ) { 23 23 wp_redirect( network_admin_url( 'setup.php' ) ); 24 24 exit; 25 25 } … … 95 95 if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) ) 96 96 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.' ) ); 97 97 98 if ( i s_network_admin() ) {98 if ( in_network_admin() ) { 99 99 $title = __( 'Network Setup' ); 100 100 $parent_file = 'settings.php'; 101 101 } else { -
wp-admin/includes/menu.php
7 7 * @subpackage Administration 8 8 */ 9 9 10 if ( i s_network_admin() )10 if ( in_network_admin() ) 11 11 do_action('_network_admin_menu'); 12 elseif ( i s_user_admin() )12 elseif ( in_user_admin() ) 13 13 do_action('_user_admin_menu'); 14 14 else 15 15 do_action('_admin_menu'); … … 89 89 } 90 90 unset($id, $data, $subs, $first_sub, $old_parent, $new_parent); 91 91 92 if ( i s_network_admin() )92 if ( in_network_admin() ) 93 93 do_action('network_admin_menu', ''); 94 elseif ( i s_user_admin() )94 elseif ( in_user_admin() ) 95 95 do_action('user_admin_menu', ''); 96 96 else 97 97 do_action('admin_menu', ''); -
wp-admin/includes/update.php
196 196 197 197 $wp_list_table = _get_list_table('WP_Plugins_List_Table'); 198 198 199 if ( i s_network_admin() || !is_multisite() ) {199 if ( in_network_admin() || !is_multisite() ) { 200 200 echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">'; 201 201 if ( ! current_user_can('update_plugins') ) 202 202 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
26 26 /* Register Widgets and Controls */ 27 27 28 28 // Right Now 29 if ( i s_blog_admin() && current_user_can('edit_posts') )29 if ( in_blog_admin() && current_user_can('edit_posts') ) 30 30 wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' ); 31 31 32 if ( i s_network_admin() )32 if ( in_network_admin() ) 33 33 wp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_dashboard_right_now' ); 34 34 35 35 // Recent Comments Widget 36 if ( i s_blog_admin() && current_user_can('moderate_comments') ) {36 if ( in_blog_admin() && current_user_can('moderate_comments') ) { 37 37 if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) { 38 38 $update = true; 39 39 $widget_options['dashboard_recent_comments'] = array( … … 45 45 } 46 46 47 47 // Incoming Links Widget 48 if ( i s_blog_admin() && current_user_can('publish_posts') ) {48 if ( in_blog_admin() && current_user_can('publish_posts') ) { 49 49 if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) { 50 50 $update = true; 51 51 $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10; … … 61 61 } 62 62 63 63 // WP Plugins Widget 64 if ( ( ! is_multisite() && i s_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' ) ) ) 65 65 wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' ); 66 66 67 67 // QuickPress Widget 68 if ( i s_blog_admin() && current_user_can('edit_posts') )68 if ( in_blog_admin() && current_user_can('edit_posts') ) 69 69 wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' ); 70 70 71 71 // Recent Drafts 72 if ( i s_blog_admin() && current_user_can('edit_posts') )72 if ( in_blog_admin() && current_user_can('edit_posts') ) 73 73 wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' ); 74 74 75 75 // Primary feed (Dev Blog) Widget … … 104 104 105 105 // Hook to register new widgets 106 106 // Filter widget order 107 if ( i s_network_admin() ) {107 if ( in_network_admin() ) { 108 108 do_action( 'wp_network_dashboard_setup' ); 109 109 $dashboard_widgets = apply_filters( 'wp_network_dashboard_widgets', array() ); 110 } elseif ( i s_user_admin() ) {110 } elseif ( in_user_admin() ) { 111 111 do_action( 'wp_user_dashboard_setup' ); 112 112 $dashboard_widgets = apply_filters( 'wp_user_dashboard_widgets', array() ); 113 113 } else { … … 153 153 154 154 if ( is_blog_admin () ) 155 155 $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary'); 156 else if (i s_network_admin() )156 else if (in_network_admin() ) 157 157 $side_widgets = array('dashboard_primary', 'dashboard_secondary'); 158 158 else 159 159 $side_widgets = array(); … … 781 781 $rss = fetch_feed( $url ); 782 782 783 783 if ( is_wp_error($rss) ) { 784 if ( i s_admin() || current_user_can('manage_options') ) {784 if ( in_admin() || current_user_can('manage_options') ) { 785 785 echo '<p>'; 786 786 printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message()); 787 787 echo '</p>'; … … 897 897 $rss = @fetch_feed( $url ); 898 898 899 899 if ( is_wp_error($rss) ) { 900 if ( i s_admin() || current_user_can('manage_options') ) {900 if ( in_admin() || current_user_can('manage_options') ) { 901 901 echo '<div class="rss-widget"><p>'; 902 902 printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message()); 903 903 echo '</p></div>'; -
wp-admin/includes/class-wp-upgrader.php
1362 1362 else 1363 1363 $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>'; 1364 1364 1365 if ( ! $this->result || is_wp_error($this->result) || i s_network_admin() )1365 if ( ! $this->result || is_wp_error($this->result) || in_network_admin() ) 1366 1366 unset( $install_actions['activate'], $install_actions['preview'] ); 1367 1367 1368 1368 $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info); -
wp-admin/includes/theme-install.php
141 141 $actions = array(); 142 142 $actions[] = '<a href="' . self_admin_url('theme-install.php?tab=theme-information&theme=' . $theme->slug . 143 143 '&TB_iframe=true&tbWidth=500&tbHeight=385') . '" class="thickbox thickbox-preview onclick" title="' . esc_attr(sprintf(__('Install “%s”'), $name)) . '">' . __('Install') . '</a>'; 144 if ( !i s_network_admin() )144 if ( !in_network_admin() ) 145 145 $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . esc_attr(sprintf(__('Preview “%s”'), $name)) . '">' . __('Preview') . '</a>'; 146 146 $actions = apply_filters('theme_install_action_links', $actions, $theme); 147 147 } -
wp-admin/includes/template.php
1662 1662 function convert_to_screen( $screen ) { 1663 1663 $screen = str_replace( array('.php', '-new', '-add', '-network', '-user' ), '', $screen); 1664 1664 1665 if ( i s_network_admin() )1665 if ( in_network_admin() ) 1666 1666 $screen .= '-network'; 1667 elseif ( i s_user_admin() )1667 elseif ( in_user_admin() ) 1668 1668 $screen .= '-user'; 1669 1669 1670 1670 $screen = (string) apply_filters( 'screen_meta_screen', $screen ); … … 2094 2094 $current_screen->taxonomy = $taxnow; 2095 2095 } 2096 2096 2097 $current_screen->is_network = i s_network_admin();2098 $current_screen->is_user = i s_user_admin();2097 $current_screen->is_network = in_network_admin(); 2098 $current_screen->is_user = in_user_admin(); 2099 2099 2100 2100 if ( $current_screen->is_network ) { 2101 2101 $current_screen->base .= '-network'; -
wp-admin/theme-editor.php
9 9 /** WordPress Administration Bootstrap */ 10 10 require_once('./admin.php'); 11 11 12 if ( is_multisite() && ! i s_network_admin() ) {12 if ( is_multisite() && ! in_network_admin() ) { 13 13 wp_redirect( network_admin_url( 'theme-editor.php' ) ); 14 14 exit(); 15 15 } … … 26 26 $help .= '<p>' . __('After typing in your edits, click Update File.') . '</p>'; 27 27 $help .= '<p>' . __('<strong>Advice:</strong> think very carefully about your site crashing if you are live-editing the theme currently in use.') . '</p>'; 28 28 $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 ( i s_network_admin() )29 if ( in_network_admin() ) 30 30 $help .= '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>'; 31 31 $help .= '<p><strong>' . __('For more information:') . '</strong></p>'; 32 32 $help .= '<p>' . __('<a href="http://codex.wordpress.org/Theme_Development" target="_blank">Documentation on Theme Development</a>') . '</p>'; -
wp-admin/load-styles.php
65 65 /** 66 66 * @ignore 67 67 */ 68 function i s_admin() {return true;}68 function in_admin() {return true;} 69 69 70 70 /** 71 71 * @ignore -
wp-admin/index.php
24 24 $title = __('Dashboard'); 25 25 $parent_file = 'index.php'; 26 26 27 if ( i s_user_admin() )27 if ( in_user_admin() ) 28 28 add_screen_option('layout_columns', array('max' => 4, 'default' => 1) ); 29 29 else 30 30 add_screen_option('layout_columns', array('max' => 4, 'default' => 2) ); -
wp-admin/plugin-install.php
15 15 if ( ! current_user_can('install_plugins') ) 16 16 wp_die(__('You do not have sufficient permissions to install plugins on this site.')); 17 17 18 if ( is_multisite() && ! i s_network_admin() ) {18 if ( is_multisite() && ! in_network_admin() ) { 19 19 wp_redirect( network_admin_url( 'plugin-install.php' ) ); 20 20 exit(); 21 21 } -
wp-admin/load-scripts.php
65 65 /** 66 66 * @ignore 67 67 */ 68 function i s_admin() {return true;}68 function in_admin() {return true;} 69 69 70 70 /** 71 71 * @ignore -
wp-admin/admin-header.php
13 13 get_admin_page_title(); 14 14 $title = esc_html( strip_tags( $title ) ); 15 15 16 if ( i s_network_admin() )16 if ( in_network_admin() ) 17 17 $admin_title = __( 'Network Admin' ); 18 elseif ( i s_user_admin() )18 elseif ( in_user_admin() ) 19 19 $admin_title = __( 'Global Dashboard' ); 20 20 else 21 21 $admin_title = get_bloginfo( 'name' ); … … 107 107 <div id="wphead"> 108 108 <?php 109 109 110 if ( i s_network_admin() )110 if ( in_network_admin() ) 111 111 $blog_name = sprintf( __('%s Network Admin'), esc_html($current_site->site_name) ); 112 elseif ( i s_user_admin() )112 elseif ( in_user_admin() ) 113 113 $blog_name = sprintf( __('%s Global Dashboard'), esc_html($current_site->site_name) ); 114 114 else 115 115 $blog_name = get_bloginfo('name', 'display'); … … 137 137 <a href="<?php echo trailingslashit( get_bloginfo( 'url' ) ); ?>" title="<?php esc_attr_e('Visit Site') ?>"> 138 138 <span id="site-title"><?php echo $blog_name ?></span> 139 139 </a> 140 <?php if ( !i s_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') ): ?> 141 141 <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> 142 142 <?php endif; ?> 143 143 </h1> … … 150 150 $links = array(); 151 151 $links[5] = sprintf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity); 152 152 if ( is_multisite() && is_super_admin() ) { 153 if ( !i s_network_admin() )153 if ( !in_network_admin() ) 154 154 $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>'; 155 155 else 156 156 $links[10] = '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>'; … … 183 183 <?php 184 184 screen_meta($current_screen); 185 185 186 if ( i s_network_admin() )186 if ( in_network_admin() ) 187 187 do_action('network_admin_notices'); 188 elseif ( i s_user_admin() )188 elseif ( in_user_admin() ) 189 189 do_action('user_admin_notices'); 190 190 else 191 191 do_action('admin_notices'); -
wp-admin/plugins.php
249 249 $plugins_to_delete = count( $plugin_info ); 250 250 echo '<h2>' . _n( 'Delete Plugin', 'Delete Plugins', $plugins_to_delete ) . '</h2>'; 251 251 ?> 252 <?php if ( $have_non_network_plugins && i s_network_admin() ) : ?>252 <?php if ( $have_non_network_plugins && in_network_admin() ) : ?> 253 253 <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> 254 254 <?php endif; ?> 255 255 <p><?php echo _n( 'You are about to remove the following plugin:', 'You are about to remove the following plugins:', $plugins_to_delete ); ?></p> … … 389 389 <div class="wrap"> 390 390 <?php screen_icon(); ?> 391 391 <h2><?php echo esc_html( $title ); 392 if ( ( ! is_multisite() || i s_network_admin() ) && current_user_can('install_plugins') ) { ?>392 if ( ( ! is_multisite() || in_network_admin() ) && current_user_can('install_plugins') ) { ?> 393 393 <a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="button add-new-h2"><?php echo esc_html_x('Add New', 'plugin'); ?></a> 394 394 <?php } 395 395 if ( $s ) -
wp-admin/user-edit.php
31 31 else 32 32 $submenu_file = 'profile.php'; 33 33 34 if ( current_user_can('edit_users') && !i s_user_admin() )34 if ( current_user_can('edit_users') && !in_user_admin() ) 35 35 $parent_file = 'users.php'; 36 36 else 37 37 $parent_file = 'profile.php'; … … 123 123 $blog_prefix = $wpdb->get_blog_prefix(); 124 124 if ( $user_id != $current_user->ID ) { 125 125 $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 ( !i s_network_admin() && null == $cap && $_POST[ 'role' ] == '' ) {126 if ( !in_network_admin() && null == $cap && $_POST[ 'role' ] == '' ) { 127 127 $_POST[ 'role' ] = 'contributor'; 128 128 $delete_role = true; 129 129 } … … 133 133 if ( $delete_role ) // stops users being added to current blog when they are edited 134 134 delete_user_meta( $user_id, $blog_prefix . 'capabilities' ); 135 135 136 if ( is_multisite() && i s_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 ) ) 137 137 empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); 138 138 } 139 139 … … 231 231 <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> 232 232 </tr> 233 233 234 <?php if ( !IS_PROFILE_PAGE && !i s_network_admin() ) : ?>234 <?php if ( !IS_PROFILE_PAGE && !in_network_admin() ) : ?> 235 235 <tr><th><label for="role"><?php _e('Role:') ?></label></th> 236 236 <td><select name="role" id="role"> 237 237 <?php … … 252 252 </select> 253 253 <?php endif; //!IS_PROFILE_PAGE 254 254 255 if ( is_multisite() && i s_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>255 if ( is_multisite() && in_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?> 256 256 <tr><th><label for="role"><?php _e('Super Admin'); ?></label></th> 257 257 <td> 258 258 <?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) ) : ?> -
wp-admin/theme-install.php
15 15 if ( ! current_user_can('install_themes') ) 16 16 wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) ); 17 17 18 if ( is_multisite() && ! i s_network_admin() ) {18 if ( is_multisite() && ! in_network_admin() ) { 19 19 wp_redirect( network_admin_url( 'theme-install.php' ) ); 20 20 exit(); 21 21 } … … 31 31 32 32 $title = __('Install Themes'); 33 33 $parent_file = 'themes.php'; 34 if ( !i s_network_admin() )34 if ( !in_network_admin() ) 35 35 $submenu_file = 'themes.php'; 36 36 37 37 wp_enqueue_style( 'theme-install' ); … … 58 58 <?php 59 59 screen_icon(); 60 60 61 if ( i s_network_admin() ) : ?>61 if ( in_network_admin() ) : ?> 62 62 <h2><?php echo esc_html( $title ); ?></h2> 63 63 <?php else : ?> 64 64 <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
9 9 /** WordPress Administration Bootstrap */ 10 10 require_once('./admin.php'); 11 11 12 if ( is_multisite() && ! i s_network_admin() ) {12 if ( is_multisite() && ! in_network_admin() ) { 13 13 wp_redirect( network_admin_url( 'update-core.php' ) ); 14 14 exit(); 15 15 } -
wp-admin/plugin-editor.php
9 9 /** WordPress Administration Bootstrap */ 10 10 require_once('./admin.php'); 11 11 12 if ( is_multisite() && ! i s_network_admin() ) {12 if ( is_multisite() && ! in_network_admin() ) { 13 13 wp_redirect( network_admin_url( 'plugin-editor.php' ) ); 14 14 exit(); 15 15 } … … 117 117 '<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’t forget to save your changes (Update File) when you’re finished.') . '</p>' . 118 118 '<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>' . 119 119 '<p>' . __('If you want to make changes but don’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 ( i s_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>' : '' ) . 121 121 '<p><strong>' . __('For more information:') . '</strong></p>' . 122 122 '<p>' . __('<a href="http://codex.wordpress.org/Plugins_Editor_SubPanel" target="_blank">Documentation on Editing Plugins</a>') . '</p>' . 123 123 '<p>' . __('<a href="http://codex.wordpress.org/Writing_a_Plugin" target="_blank">Documentation on Writing Plugins</a>') . '</p>' .