Running wp_ actions on backend
|Reported by:||thomask||Owned by:|
I'm not sure if this is a bug, feature or just unclear documentation, but IMO it is something what was not planned at the begining: if you look in the Codex about the actions (http://codex.wordpress.org/Plugin_API/Action_Reference), there are many actions which are under "Actions Run During a Typical Request", but are not under "Actions Run During an Admin Page Request" - there are similar functions with admin_prefix. E.g. wp_head, wp_enqueue_scripts etc.
From this Codex i would guess that those action do NOT run under Admin page request, but it is not true - they are started.
Under that "Actions Run During an Admin Page Request" there is also wp* action, what could mean, that any wp* action runs as well, so it may be intentional, but from that fact that they are explicitly listed on first list and not on the second, i guess that it is wrong.
A also think that it is wrong by design - probably there are minimum to zero actions, which you need to do both at admin AND frontend simultaneously - so now many plugins wrongly run scripts or include something in header of backend unnecessarily, what slows down backend, few of them noticed this problem so they they use !is_admin()
So solution could be
a) do not run all wp* actions on backend (but it may destroy some admin related plugins whoose authors do not notice the admin_ prefixed alternatives)
b) or clarify the Codex and maybe create something like frontend_ prefixed actions, for those who want to address just the frontend
P.S.: this "bug" is for all versions, not just 3.2