is_admin() returns true when using admin-ajax.php from front end script

WordPress sets is_admin() to true for all ajax requests (front-end or admin-side). (See codex).

There’s isn’t away of over-riding this (and you shouldn’t anyway). If your ajax request can be fired from both front-end and admin side, then you may want to include whether it ‘is admin’ or not when you post the data. But without any details on the ‘issues’ it causes with your plug-in, it’s hard to offer a work-aroudn.

Leave a Comment