is_admin()
Determines whether the current request is for an administrative interface page.
Description
Does not check if the user is an administrator; use current_user_can() for checking roles and capabilities.
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
Return
(bool) True if inside WordPress administration interface, false otherwise.
Source
File: wp-includes/load.php
function is_admin() {
if ( isset( $GLOBALS['current_screen'] ) )
return $GLOBALS['current_screen']->in_admin();
elseif ( defined( 'WP_ADMIN' ) )
return WP_ADMIN;
return false;
}
Related
Used By
Used By | Description |
---|---|
wp-admin/includes/class-wp-site-health.php: WP_Site_Health::check_wp_version_check_exists() |
Tests whether |
wp-includes/load.php: wp_is_site_protected_by_basic_auth() |
Checks if this site is protected by HTTP Basic Auth. |
wp-includes/load.php: is_protected_endpoint() |
Determines whether we are currently on an endpoint that should be protected against WSODs. |
wp-includes/l10n.php: determine_locale() |
Determines the current locale desired for the request. |
wp-includes/class-wp-fatal-error-handler.php: WP_Fatal_Error_Handler::handle() |
Runs the shutdown handler. |
wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php: WP_REST_Site_Health_Controller::load_admin_textdomain() |
Loads the admin textdomain for Site Health tests. |
wp-includes/deprecated.php: wp_admin_bar_dashboard_view_site_menu() |
Add the “Dashboard”/”Visit Site” menu. |
wp-includes/customize/class-wp-customize-nav-menu-item-setting.php: WP_Customize_Nav_Menu_Item_Setting::sort_wp_get_nav_menu_items() |
Re-apply the tail logic also applied on $items by wp_get_nav_menu_items(). |
wp-includes/general-template.php: wp_heartbeat_settings() |
Default settings for heartbeat. |
wp-includes/script-loader.php: script_concat_settings() |
Determines the concatenation and compression settings for scripts and styles. |
wp-includes/script-loader.php: wp_default_scripts() |
Register all ClassicPress scripts. |
wp-includes/class-wp-post-type.php: WP_Post_Type::add_rewrite_rules() |
Adds the necessary rewrite rules for the post type. |
wp-includes/class-wp-post-type.php: WP_Post_Type::set_props() |
Sets post type properties. |
wp-includes/class-wp-taxonomy.php: WP_Taxonomy::set_props() |
Sets taxonomy properties. |
wp-includes/class-wp-taxonomy.php: WP_Taxonomy::add_rewrite_rules() |
Adds the necessary rewrite rules for the taxonomy. |
wp-includes/class-wp-customize-widgets.php: WP_Customize_Widgets::schedule_customize_register() |
Ensures widgets are available for all types of previews. |
wp-includes/l10n.php: load_default_textdomain() |
Loads default translated strings based on locale. |
wp-includes/class-wp-query.php: WP_Query::parse_query() |
Parse a query string and set query type booleans. |
wp-includes/nav-menu.php: wp_get_nav_menu_items() |
Retrieves all menu items of a navigation menu. |
wp-includes/admin-bar.php: is_admin_bar_showing() |
Determines whether the admin bar should be showing. |
wp-includes/admin-bar.php: wp_admin_bar_edit_menu() |
Provides an edit link for posts and terms. |
wp-includes/admin-bar.php: wp_admin_bar_search_menu() |
Adds search form. |
wp-includes/admin-bar.php: wp_admin_bar_sidebar_toggle() |
Adds the sidebar toggle button. |
wp-includes/admin-bar.php: wp_admin_bar_site_menu() |
Adds the “Site Name” menu. |
wp-includes/admin-bar.php: wp_admin_bar_customize_menu() |
Adds the “Customize” link to the Toolbar. |
wp-includes/class-wp-admin-bar.php: WP_Admin_Bar::_render() | |
wp-includes/ms-load.php: ms_not_installed() |
Displays a failure message. |
wp-includes/link-template.php: get_pagenum_link() |
Retrieves the link for a page number. |
wp-includes/functions.wp-scripts.php: wp_deregister_script() |
Removes a registered script. |
wp-includes/post-formats.php: _post_format_request() |
Filters the request to allow for the format prefix. |
wp-includes/class-wp-theme.php: WP_Theme::get_allowed_on_site() |
Returns array of stylesheet names of themes allowed on the site. |
wp-includes/theme.php: _wp_customize_include() |
Includes and instantiates the WP_Customize_Manager class. |
wp-includes/theme.php: _custom_header_background_just_in_time() |
Registers the internal custom header and background routines. |
wp-includes/theme.php: remove_editor_styles() |
Removes all visual editor stylesheets. |
wp-includes/theme.php: get_theme_mods() |
Retrieves all theme modifications. |
wp-includes/theme.php: switch_theme() |
Switches the theme. |
wp-includes/option.php: wp_user_settings() |
Saves and restores user interface settings stored in a cookie. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::establish_loaded_changeset() |
Establishes the loaded changeset. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::wp_loaded() |
Registers styles/scripts and initialize the preview of each setting |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::wp_redirect_status() |
Prevents Ajax requests from following redirects when previewing a theme by issuing a 200 response instead of a 30x. |
wp-includes/post-template.php: get_post_class() |
Retrieves an array of the class names for the post container element. |
wp-includes/post-template.php: get_the_title() |
Retrieves the post title. |
wp-includes/canonical.php: redirect_canonical() |
Redirects incoming links to the proper URL based on the site url. |
wp-includes/rest-api.php: get_rest_url() |
Retrieves the URL to a REST endpoint on a site. |
wp-includes/post.php: wp_get_attachment_url() |
Retrieves the URL for an attachment. |
wp-includes/class-wp.php: WP::parse_request() |
Parses the request to find the correct WordPress query. |
wp-includes/class-wp.php: WP::handle_404() |
Set the Headers for 404, if nothing is found for requested URL. |
wp-includes/class-wp-editor.php: _WP_Editors::editor_settings() | |
wp-includes/class-wp-editor.php: _WP_Editors::enqueue_default_editor() |
Enqueue all editor scripts. |
wp-includes/class-wp-editor.php: _WP_Editors::editor_js() |
Print (output) the TinyMCE configuration and initialization scripts. |
wp-includes/widgets.php: wp_convert_widget_settings() |
Converts the widget settings from single to multi-widget format. |
wp-includes/widgets.php: wp_widget_rss_output() |
Display the RSS entries in a list. |
wp-includes/widgets.php: wp_get_sidebars_widgets() |
Retrieve full list of sidebars and their widget instance IDs. |
wp-includes/widgets.php: dynamic_sidebar() |
Display dynamic sidebar. |
wp-includes/functions.php: wp_auth_check_load() |
Loads the auth check for monitoring whether the user is still logged in. |
wp-admin/includes/plugin.php: wp_add_privacy_policy_content() |
Declares a helper function for adding content to the Privacy Policy Guide. |
Changelog
Version | Description |
---|---|
1.5.1 | Introduced. |