WordPress.org

Make WordPress Core

Changeset 12393


Ignore:
Timestamp:
12/14/09 00:38:05 (4 years ago)
Author:
azaozz
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r12372 r12393  
    8686 * Query type checks. 
    8787 */ 
    88  
    89 /** 
    90  * Whether the current request is in WordPress admin Panel 
    91  * 
    92  * Does not inform on whether the user is an admin! Use capability checks to 
    93  * tell if the user should be accessing a section or not. 
    94  * 
    95  * @since 1.5.1 
    96  * 
    97  * @return bool True if inside WordPress administration pages. 
    98  */ 
    99 function is_admin () { 
    100     if ( defined('WP_ADMIN') ) 
    101         return WP_ADMIN; 
    102     return false; 
    103 } 
    10488 
    10589/** 
  • trunk/wp-settings.php

    r12384 r12393  
    306306    } 
    307307    return $can_clone ? clone( $object ) : $object; 
     308} 
     309 
     310/** 
     311 * Whether the current request is in WordPress admin Panel 
     312 * 
     313 * Does not inform on whether the user is an admin! Use capability checks to 
     314 * tell if the user should be accessing a section or not. 
     315 * 
     316 * @since 1.5.1 
     317 * 
     318 * @return bool True if inside WordPress administration pages. 
     319 */ 
     320function is_admin() { 
     321    if ( defined('WP_ADMIN') ) 
     322        return WP_ADMIN; 
     323    return false; 
    308324} 
    309325 
Note: See TracChangeset for help on using the changeset viewer.