Faisal Ijaz
Faisal Ijaz

Reputation: 1892

WordPress hook to call a function in dashboard other than admin

Is there any WordPress hook that can be called on dashboard other than admin.

i have this hook

add_action('admin_head','upgrade_notification_free_user');

it works fine for the admin account but when i login from another account it do not fires.

Any suggestions?

Upvotes: 1

Views: 1837

Answers (1)

Lille Hummer
Lille Hummer

Reputation: 629

According to the WordPress Code Reference the 'admin_head' action should fire in the head section of all admin pages.

Alternatively you could try 'admin_init' or 'in_admin_footer' depending on what your function is trying to accomplish.

Try installing the Query Monitor plugin it will show you all hooks that are fired when a page is loaded. Make sure to use a special authentication cookie - see here for details - so non-administrators will also see Query Monitor's output.

Upvotes: 1

Related Questions