Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1741 closed defect (bug) (fixed)

is_admin() always returns false?

Reported by: Sebbi Owned by: markjaquith
Milestone: Priority: normal
Severity: trivial Version: 2.0
Component: Administration Keywords: is_admin bg|commit bg|has-patch
Focuses: Cc:


I don't know why that happens, but I noticed that the is_admin()-function returns false at least in the moderation.php, maybe always?

Attachments (1)

is_admin-FIX.diff (1.5 KB) - added by markjaquith 16 years ago.
Fix for WP 2.0 SVN

Download all attachments as: .zip

Change History (10)

#1 @skeltoac
16 years ago

Sebbi, are you testing is_admin() during plugin load, before is_*() are ready?

#2 @markjaquith
16 years ago

I think you have to wait for the query to be run, which means that you either need to use it within a theme file, or using the template_redirect hook. "init" and "plugins_loaded" may be too early to use it. Don't take that as Gospel... but I think that's right.

Sebbi, how are you using is_admin()? In what context?

#3 @markjaquith
16 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

#4 @markjaquith
16 years ago

  • Milestone set to 2.0
  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Version changed from 1.5.2 to 2.0

16 years ago

Fix for WP 2.0 SVN

#5 @markjaquith
16 years ago

  • Keywords bg|2nd-opinion bg|has-patch added
  • Owner changed from anonymous to markjaquith
  • Status changed from reopened to new

#6 @markjaquith
16 years ago

  • Status changed from new to assigned

#7 @markjaquith
16 years ago

  • Keywords bg|commit added; bg|2nd-opinion removed

#8 @ryan
16 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [3286]) Fix is_admin() for situations where the query is not run. fixes #1741

#9 @(none)
15 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.