is_admin Not working
-
I have a plugin that relies on is_admin returning true when save_post is fired from the editor screen. The new editor does not seem to return true when is_admin is called after clicking the update button. I have tried a number of work arounds such as this function but it to fails to recognize that it is on the editor screen.
function is_admin_request() {
$current_url = home_url( add_query_arg( null, null ) );
$admin_url = strtolower( admin_url() );
if ( strpos( $current_url, $admin_url ) ) {
return 1;
}if(wp_doing_ajax()) return 1;
return 0;
}
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘is_admin Not working’ is closed to new replies.