The admin_user_info_links filter is gone in 3.3
Version 3.3 combines the admin header and the admin bar into one toolbar in the dashboard.
As the “Howdy” dropdown menu in the admin is now part of the admin bar, we’ve dropped the admin_user_info_links filter. This filter was previously used by plugins to insert links near “Howdy, name | Logout” and eventually as items in the dropdown added in 3.2.
Now what you can do is add links to the account menu, like so:
add_action( 'admin_bar_menu', 'nacin_add_account_menu_item' );
function nacin_add_account_menu_item( $wp_admin_bar ) {
$wp_admin_bar->add_node( array(
'id' => 'secondary-profile-page',
'parent' => 'user-actions',
'title' => 'Personal Settings',
'href' => menu_page_url( ... ),
) );
}
This follows us dropping favorite actions (and specifically the favorite_actions filter) in 3.2 as the UI continues to be refined.
Thomas Griffin 3:34 pm on December 9, 2011 Permalink
Why is the word ‘Howdy’ still not filterable? I find I am requested to change the Howdy text on nearly all white-label projects by client request. Couldn’t it be something as simple as:
$howdy = sprintf( __('%1$s, %2$s'), apply_filters( 'change_howdy_text', 'Howdy' ), $current_user->display_name );Or whatever semantic name you want to call it, and then themes/plugin authors could do this:
add_filter( 'change_howdy_text', 'tgm_custom_howdy_text' );function tgm_custom_howdy_text( $howdy ) {
return 'Welcome Back';
}
Maybe I just don’t understand the logic why this couldn’t be included?
Jane Wells 6:20 pm on December 9, 2011 Permalink
We haven’t talked about it in a while, but in the past it’s been one of those things that was considered part of WordPress’s character, vs an all-things-to-all-people ‘feature’. Will likely come up again at the core team meetup next week.
Thomas Griffin 7:52 pm on December 9, 2011 Permalink
I completely understand that, so I’d never want to see ‘Howdy’ completely gone, but the line between WordPress websites and WordPress-powered websites is increasingly most distinctive, and those on the WordPress-powered side don’t find Howdy particularly endearing.
Bjørn Johansen 7:58 am on December 11, 2011 Permalink
If this really is considered part of WP’s character, why does all the WP sites (e.g. http://wordpress.org/extend/plugins/) greets me with “Welcome, Bjørn Johansen”, and not “Howdy, Bjørn Johansen”?
Andrew Nacin 6:26 pm on December 9, 2011 Permalink
There should probably be a targeted filter on that string. But this works:
add_action( 'admin_bar_menu', function( $wp_admin_bar ) { $avatar = get_avatar( get_current_user_id(), 16 ); if ( ! $wp_admin_bar->get_node( 'my-account' ) ) return; $wp_admin_bar->add_node( array( 'id' => 'my-account', 'title' => sprintf( 'Hi there, %s', wp_get_current_user()->display_name ) . $avatar, ) ); } );And all translated strings also run through a filter.
Thomas Griffin 7:55 pm on December 9, 2011 Permalink
Both of those routes, while working, are going around your elbow to get to your arm. It’d be much more concise and simple just to filter it outright. Just my opinion. I’ll submit a ticket and patch and let the powers that be decide its fate.
Matt 12:59 am on December 10, 2011 Permalink
Would rather not.
Thomas Griffin 2:32 am on December 10, 2011 Permalink
I guess fate made a quick decision then. I still think it would be nice to have, but again it’s just my opinion.
Mark 7:49 pm on January 3, 2012 Permalink
You guys ever heard of backward compatibility of software? You change things in new versions so all websites on old versions will break? You are Gods who can show up one day and decide to change this filter or that?
This is what happens when kids run the world.
Andrew Nacin 8:29 pm on January 3, 2012 Permalink
Hi Mark,
We take the requirement of backwards compatibility very seriously, more than most projects in fact. While standard software versioning allows for backwards incompatible changes in major versions (3.3 is a major version for us; think of it like 33), we strive to never introduce a backwards incompatible change. Ever. There are going to be a select few every release, but we strive to never break someone’s site, even if a change ended up breaking a plugin that was doing something wrong in the first place.
The nice thing about filters is that removing one won’t cause any fatal errors. In this case, the absolute worst thing that can happen is that a shortcut link or two might have disappeared from a dropdown that only existed for one version.
Also of note, before removing the filter, we scanned the entire plugins directory hosted on WordPress.org to ascertain how widely used the filter was. It was limited to less than a dozen plugins. You can see our discussion here. I think it’s clear we don’t take these changes lightly.
Cheers,
Nacin