Last active
February 9, 2025 22:04
-
-
Save tomdevisser/8e0e84f8838f796b9fbce9b38691ae50 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Priority 100 appends it after the default admin nodes. | |
add_action( 'wp_before_admin_bar_render', 'toms_admin_bar_menu', 100, 1 ); | |
/** | |
* Adds custom nodes to the WP admin bar menu. | |
* | |
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance, passed by reference. | |
* @return void | |
*/ | |
function toms_admin_bar_menu( WP_Admin_Bar $wp_admin_bar ): void { | |
$wp_admin_bar->add_node( | |
array( | |
'id' => 'get-support', | |
'title' => __( 'Get support', 'toms' ), | |
'href' => 'mailto:[email protected]', | |
'meta' => array( | |
'target' => '_blank' | |
) | |
) | |
); | |
$wp_admin_bar->add_node( | |
array( | |
'id' => 'get-priority-support', | |
'parent' => 'get-support', | |
'title' => __( 'High priority', 'toms' ), | |
'href' => 'tel:0000000000', | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment