Move is_admin() to wp-settings.php so it's available when query.php is not included.

git-svn-id: http://svn.automattic.com/wordpress/trunk@12393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-12-14 00:38:05 +00:00
parent b300deaf01
commit 1c55a42fa0
2 changed files with 16 additions and 16 deletions

View File

@ -86,22 +86,6 @@ function wp_reset_query() {
* Query type checks.
*/
/**
* Whether the current request is in WordPress admin Panel
*
* Does not inform on whether the user is an admin! Use capability checks to
* tell if the user should be accessing a section or not.
*
* @since 1.5.1
*
* @return bool True if inside WordPress administration pages.
*/
function is_admin () {
if ( defined('WP_ADMIN') )
return WP_ADMIN;
return false;
}
/**
* Is query requesting an archive page.
*

View File

@ -307,6 +307,22 @@ function wp_clone( $object ) {
return $can_clone ? clone( $object ) : $object;
}
/**
* Whether the current request is in WordPress admin Panel
*
* Does not inform on whether the user is an admin! Use capability checks to
* tell if the user should be accessing a section or not.
*
* @since 1.5.1
*
* @return bool True if inside WordPress administration pages.
*/
function is_admin() {
if ( defined('WP_ADMIN') )
return WP_ADMIN;
return false;
}
if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) {
require_once (WP_CONTENT_DIR . '/object-cache.php');
$_wp_using_ext_object_cache = true;