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

Loads all necessary admin bar items.

This hook can add, remove, or manipulate admin bar items. The priority determines the placement for new items, and changes to existing items would require a high priority. To remove or manipulate existing nodes without a specific priority, use wp_before_admin_bar_render.

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

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 97
do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) );

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

wp-includes/class-wp-admin-bar.php 650
add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 0 );
wp-includes/class-wp-admin-bar.php 651
add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 9991 );
wp-includes/class-wp-admin-bar.php 652
add_action( 'admin_bar_menu', 'wp_admin_bar_recovery_mode_menu', 9992 );
wp-includes/class-wp-admin-bar.php 653
add_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 9999 );
wp-includes/class-wp-admin-bar.php 656
add_action( 'admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0 );
wp-includes/class-wp-admin-bar.php 657
add_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 );
wp-includes/class-wp-admin-bar.php 658
add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
wp-includes/class-wp-admin-bar.php 659
add_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 );
wp-includes/class-wp-admin-bar.php 660
add_action( 'admin_bar_menu', 'wp_admin_bar_edit_site_menu', 40 );
wp-includes/class-wp-admin-bar.php 661
add_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 );
wp-includes/class-wp-admin-bar.php 662
add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 50 );
wp-includes/class-wp-admin-bar.php 666
add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );
wp-includes/class-wp-admin-bar.php 667
add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 );
wp-includes/class-wp-admin-bar.php 669
add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );
wp-includes/class-wp-admin-bar.php 671
add_action( 'admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200 );