Nice one, thanks for the clarification, couldn't understand why is_admin() was false all the time for me on a frontend page!
One thing maybe extra to note is that if you're writing a plugin, the functions you suggest using may not even exist until a certain point in the boot sequence. I've found it's safe in the plugins_loaded action.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice one, thanks for the clarification, couldn't understand why
is_admin()
was false all the time for me on a frontend page!One thing maybe extra to note is that if you're writing a plugin, the functions you suggest using may not even exist until a certain point in the boot sequence. I've found it's safe in the
plugins_loaded
action.