do_action( 'admin_init' )

Fires as an admin screen or script is being initialized.

Description

Note, this does not just run on user-facing admin screens. It runs on admin-ajax.php and admin-post.php as well.

This is roughly analogous to the more general ‘init’ hook, which fires earlier.

More Information

admin_init is triggered before any other hook when a user accesses the admin area.

This hook doesn’t provide any parameters, so it can only be used to callback a specified function.

Source

File: wp-admin/admin.php

View on Trac

Changelog

Version Description
2.5.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/admin_init