Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7752 closed defect (bug) (fixed)

is_admin() false inside admin-ajax.php

Reported by: Malaiac Owned by:
Milestone: 2.7 Priority: normal
Severity: minor Version: 2.6.1
Component: Administration Keywords: admin ajax
Focuses: Cc:


tested :

// admin-ajax.php, start of file (after require_once)
if(is_admin()) echo 'is _admin';

won't work.

May harm some conditional dependencies, or plugin queries.

Change History (5)

#1 @DD32
7 years ago

define('DOING_AJAX', true);
define('WP_ADMIN', true);



if ( !is_user_logged_in() )

results in 'boolean true' for me under 2.7, I dont have a 2.6.x checkout to test on though.

#2 @Malaiac
7 years ago

  • Milestone set to 2.8

#3 @Malaiac
7 years ago

same lines, give me boolean(false) on 2.6.2
but no 2.7 to test under.

let's say this bug has been fixed in trunk ?

#4 @azaozz
7 years ago

  • Milestone changed from 2.8 to 2.7
  • Resolution set to fixed
  • Status changed from new to closed

Yes, in trunk it returns true.

#5 @Viper007Bond
7 years ago

Shouldn't this be worksforme?

Note: See TracTickets for help on using tickets.