Skip to content

Instantly share code, notes, and snippets.

@BoweFrankema
Last active December 20, 2015 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BoweFrankema/6186364 to your computer and use it in GitHub Desktop.
Save BoweFrankema/6186364 to your computer and use it in GitHub Desktop.
Adding a "My Home" menu item to your navigation menu. #cbox Full tutorial: http://commonsinabox.org/archives/3271
/**
* Add a Custom "My Profile" link to the Main Menu
*
*/
function cbox_custom_profile_menu_item ( $items, $args ) {
if ($args->theme_location == 'main-menu') {
$profilelink = '<li class="my-home-menu"><a href="' . bp_loggedin_user_domain( '/' ) . '">' . __('My Home') . '</a></li>';
$items .= '';
$items = $items . $profilelink;
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'cbox_custom_profile_menu_item', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment