admin_init WordPress Action Hook

The admin_init hook is triggered after the user is authenticated and the admin_menu hook is ran. This hook is used to initialize user session data, load language files, and perform other initialization tasks for the admin panel.

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.


Top ↑

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.


Top ↑

Source

File: wp-admin/admin.php

View on Trac


Top ↑

Changelog

Changelog
VersionDescription
2.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.