Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • I want to run a function on every pageload to check the current user's metadata. Function must run on front-end and admin pages. What is the best hook to use for this? Commented Mar 5, 2015 at 16:41
  • What does the function do? Commented Mar 5, 2015 at 16:44
  • It get's the current user's meta data key 'foobar' and updates it depending on the value of the key. Commented Mar 5, 2015 at 17:00
  • Your best bet is wp_loaded, it runs on all page types and you'll have access to pretty much all wordpress functions. Commented Mar 5, 2015 at 17:03