Answer the question
In order to leave comments, you need to log in
How to add text to the toolbar?
I want to add just text to the toolbar, or more precisely, the number of the current version of WordPress.
But in the documentation and in all googled examples, a menu is added via add_menu.
So far, it has only turned out this way, but this is some kind of crutch.
add_action( 'admin_bar_menu', 'my_admin_bar_menu', 150 );
function my_admin_bar_menu( $wp_admin_bar ) {
$wp_admin_bar->add_menu( array(
'title' => 'Версия '.get_bloginfo ('version'),
) );
}
add_action( 'wp_before_admin_bar_render', 'custom_toolbar', 99 )
function custom_toolbar() {
bloginfo ('version');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question