admin_bar_menu хук-событиеWP 3.1.0

Loads all necessary admin bar items.

This is the hook used to add, remove, or manipulate admin bar items.

Использование

add_action( 'admin_bar_menu', 'wp_kama_admin_bar_menu_action' );

/**
 * Function for `admin_bar_menu` action-hook.
 * 
 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance, passed by reference.
 *
 * @return void
 */
function wp_kama_admin_bar_menu_action( $wp_admin_bar ){

	// action...
}
$wp_admin_bar(WP_Admin_Bar)
The WP_Admin_Bar instance, passed by reference.

Список изменений

С версии 3.1.0 Введена.

Где вызывается хук

wp_admin_bar_render()
admin_bar_menu
wp-includes/admin-bar.php 95
do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) );

Где используется хук в WordPress

wp-includes/class-wp-admin-bar.php 635
add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 0 );
wp-includes/class-wp-admin-bar.php 636
add_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 4 );
wp-includes/class-wp-admin-bar.php 637
add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 7 );
wp-includes/class-wp-admin-bar.php 638
add_action( 'admin_bar_menu', 'wp_admin_bar_recovery_mode_menu', 8 );
wp-includes/class-wp-admin-bar.php 641
add_action( 'admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0 );
wp-includes/class-wp-admin-bar.php 642
add_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 );
wp-includes/class-wp-admin-bar.php 643
add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
wp-includes/class-wp-admin-bar.php 644
add_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 );
wp-includes/class-wp-admin-bar.php 645
add_action( 'admin_bar_menu', 'wp_admin_bar_edit_site_menu', 40 );
wp-includes/class-wp-admin-bar.php 646
add_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 );
wp-includes/class-wp-admin-bar.php 647
add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 50 );
wp-includes/class-wp-admin-bar.php 651
add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );
wp-includes/class-wp-admin-bar.php 652
add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 );
wp-includes/class-wp-admin-bar.php 654
add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );
wp-includes/class-wp-admin-bar.php 656
add_action( 'admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200 );