Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Filter wp_nav_menu() to add profile link to a specific wp_nav_menu
- // For example: 'theme_location' =>'mamamia'
- // Replace mamamia with your menu's theme_location
- function mme_nav_menu_profile_link($menu, $args) {
- $profilelink = '<li><a href="' . bp_loggedin_user_domain( '/' ) . '">' . __('My Profile', 'buddypress' ) . '</a></li>';
- if (is_user_logged_in() && ‘mamamia’ == $args->theme_location )
- return $profilelink . $menu;
- else
- return $menu;
- }
- add_filter( ‘wp_nav_menu_items’, ‘mme_nav_menu_profile_link’, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement