Should I use is_admin() inside ‘admin_init’ hook callback

Yep, pointless.

admin_init only fires in admin area (and couple more files related to AJAX functionality) so additional is_admin() check is not necessary.

It often comes up in examples for hooks that fire both on front-end and admin area.

Leave a Comment

error code: 523