Skip to content

trepmal.com

  • Home
  • Plugins
  • Github
  • Me on WP.org
  • Donate

Categories

  • WordPress Bits (149)
  • Uncategorized (11)
  • Scripts (5)
  • Tidbits (5)
  • Fun (3)

Tags

  • wordpress (30)
  • administration (16)
  • plugin (9)
  • free download (8)
  • functions.php (8)

Year

  • 2018 (8)
  • 2016 (2)
  • 2015 (4)
  • 2014 (19)
  • 2013 (11)

Global: blog_id

Add More to the “Howdy” Line

Want to put something else besides “Howdy” and “Log Out” in the upper right hand corner? It’s easy!

add_filter('admin_user_info_links', 'add_user_id_to_top');
function add_user_id_to_top($links) {
	global $current_user;
	get_currentuserinfo();
	$links[] = ' | User ID: '. $current_user->ID;
	return $links;
}

In this example, we’re adding the current user’s ID to the top. I also like adding the blog ID up there when working on a WordPress network.

add_filter('admin_user_info_links', 'add_site_id_to_top');
function add_site_id_to_top($links) {
	global $blog_id;
	$links[] = ' | Site ID: '. $blog_id;
	return $links;
}
Posted on February 26, 2011March 1, 2012Categories WordPress BitsTags administrationLeave a comment on Add More to the “Howdy” Line
Proudly powered by WordPress