WordPress.org

Make WordPress Core

Ticket #5487: 5487.patch

File 5487.patch, 738 bytes (added by pishmishy, 13 years ago)

New patch improves is_admin()

  • wp-includes/query.php

     
    3232 */
    3333
    3434function is_admin () {
    35         global $wp_query;
    36 
    37         return ($wp_query->is_admin || (stripos($_SERVER['REQUEST_URI'], 'wp-admin/') !== false));
     35        if ( defined('WP_ADMIN') )
     36                return WP_ADMIN;
     37        return false;
    3838}
    3939
    4040function is_archive () {
  • wp-admin/admin.php

     
    11<?php
     2define('WP_ADMIN',TRUE);
    23if ( defined('ABSPATH') )
    34        require_once( ABSPATH . 'wp-config.php');
    45else