Duplicate Snippet
Embed Snippet on Your Site
Change “Howdy Admin” in Admin Bar
Customize the "Howdy" message in the admin bar.
Code Preview
php
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
function wpcode_snippet_replace_howdy( $wp_admin_bar ) {
// edit the line below to set what you want the admin bar to display intead of “howdy,”.
$new_howdy = ‘welcome,’;
$my_account = $wp_admin_bar->get_node( ‘my-account’ );
$wp_admin_bar->add_node(
array(
‘id’ => ‘my-account’,
‘title’ => str_replace( ‘howdy,’, $new_howdy, $my_account->title ),
)
);
}
add_filter( ‘admin_bar_menu’, ‘wpcode_snippet_replace_howdy’, 25 );
function wpcode_snippet_replace_howdy( $wp_admin_bar ) {
// edit the line below to set what you want the admin bar to display intead of “howdy,”.
$new_howdy = ‘welcome,’;
$my_account = $wp_admin_bar->get_node( ‘my-account’ );
$wp_admin_bar->add_node(
array(
‘id’ => ‘my-account’,
‘title’ => str_replace( ‘howdy,’, $new_howdy, $my_account->title ),
)
);
}
add_filter( ‘admin_bar_menu’, ‘wpcode_snippet_replace_howdy’, 25 )|;
add_filter( ‘wpcode_code_snippets_table_prepare_items_args’, function( $args ) {
if ( ! isset( $_GET[‘orderby’] ) ) {
$args[‘orderby’] = ‘title’;
}
if ( ! isset( $_GET[‘order’] ) ) {
$args[‘order’] = ‘ASC’;
}
return $args;
});