Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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