0

I'm trying to figure out the best approach to add additional functionality that will only be utilized by admins via /wp-admin.

What's the best way to implement so that resources aren't being wasted. I.E. if statement each page load or any other code execution on each page load for areas not even pertaining to the dashboard.

Thanks.

1 Answer 1

1

There is number of dynamic hooks in admin-header.php that allows to precisely target on which pages to load your code.

And naturally current_user_can() check so it only runs for admins.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.