You appear to be a bot. Output may be restricted
Description
Implement "admin_bar_menu" for oik-userThis action hook runs after other action hooks to alter the "Howdy," prefix for 'my-account' Note: If the main site has overridden "Howdy," then the user can't override it himself. The structure we're changing is the node for 'my-account' e.g.
[id] => my-account [parent] => top-secondary [title] => Howdy, vsgloik<img alt='' onerror='this.src="http://qw/wordpress/wp-content/themes/rngs0721/images/no-avatar.jpg"' src='http://1.gravatar.com/avatar/1c32865f0cfb495334dacb5680181f2d?s=26&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D26&r=G' class='avatar avatar-26 photo' height='26' width='26' /> [href] => http://qw/wordpress/wp-admin/profile.php [meta] => Array ( [class] => with-avatar [title] => My Account )
Usage
oiku_admin_bar_menu( $wp_admin_bar );
Parameters
- $wp_admin_bar
- ( mixed ) required –
Returns
voidSource
File name: oik-user/oik-user.phpLines:
1 to 12 of 12
function oiku_admin_bar_menu( &$wp_admin_bar ) { $current_user = wp_get_current_user(); $replace = bw_get_user_field( $current_user->ID, "howdy", "bw_options" ); if ( $replace ) { $node = $wp_admin_bar->get_node( 'my-account' ); $howdy = sprintf( __('Howdy, %1$s'), $current_user->display_name ); //bw_trace2( $node, "node" ); $replace = $replace . " " . $current_user->display_name; $node->title = str_replace( $howdy, $replace, $node->title ); $wp_admin_bar->add_node( $node ); } }View on GitHub