admin_menu
Action HookDescription
Fires before the administration menu loads in the admin.Hook Information
File Location |
wp-admin/includes/menu.php
View on GitHub
|
Hook Type | Action |
Line Number | 161 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$context
|
Empty context. |
Usage Examples
Basic Usage
<?php
// Hook into admin_menu
add_action('admin_menu', 'my_custom_function', 10, 1);
function my_custom_function($context) {
// Your custom code here
}
Source Code Context
wp-admin/includes/menu.php:161
- How this hook is used in WordPress core
<?php
156 *
157 * @since 1.5.0
158 *
159 * @param string $context Empty context.
160 */
161 do_action( 'admin_menu', '' );
162 }
163
164 /*
165 * Remove menus that have no accessible submenus and require privileges
166 * that the user does not have. Run re-parent loop again.
PHP Documentation
<?php
/**
* Fires before the administration menu loads in the admin.
*
* @since 1.5.0
*
* @param string $context Empty context.
*/
Quick Info
- Hook Type: Action
- Parameters: 1
- File: wp-admin/includes/menu.php
Related Hooks
Related hooks will be displayed here in future updates.