#7752 closed defect (bug) (fixed)
is_admin() false inside admin-ajax.php
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.7 |
| Component: | Administration | Version: | 2.6.1 |
| Severity: | minor | Keywords: | admin ajax |
| Cc: |
Description
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)
comment:3
Malaiac
— 5 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 ?
comment:4
azaozz
— 5 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.
comment:5
Viper007Bond
— 5 years ago
Shouldn't this be worksforme?
Note: See
TracTickets for help on using
tickets.
define('DOING_AJAX', true); define('WP_ADMIN', true); require_once('../wp-load.php'); require_once('includes/admin.php'); var_dump(is_admin()); if ( !is_user_logged_in() ) die('-1');results in 'boolean true' for me under 2.7, I dont have a 2.6.x checkout to test on though.