Hi @nabilyazghi,
You could perhaps use something like this:
function blabla() {
if ( ! bp_is_my_profile() )
$nav_array = 'what_you_need';
return $nav_array;
}
add_filter('bp_get_displayed_user_nav', 'blabla', 10, 1 );
Function ref: http://hookr.io/plugins/buddypress/2.4.3/functions/bp_get_displayed_user_nav/
Hi,Thank you for your replu danbp,that is a good one,however I need exaclty the content of $nav_array even if the user is not logged in and he is not in the profile page of a user,
as an example,I want to include the nav bar in another page but I can not do it because no datas are returned
I’m wondering why you don’t use WP Menu to do that !
Dashboard > Apparance > Menu > add new menu and select from BP options.
If not visible, activate BuddyPress in screen options (top right corner).
Within the appearing BP options (left column) select the items you need for the new menu. Then activate that menu on your custom page.
This menu is always contextual and is showed to everyone, whatever his status.
Hi,
I didn’t get what did you meant,but for me my aim is to include the profile page of specific user in another separate page(I searched in the net but all plugins do not do the task which I want) I did some coding(trying to set the displayed_user_id var) and I get all informations about the user,however I can’t get the nav_bar items of it,is there a solution which I can do?
Regards,
Basically, you’re trying to built a page menu. That’s WP territory
See here an example using wp_page_menu function which may help to going further:
https://buddypress.org/support/topic/notification-count-in-dynamic-menu/
Hi,
Thank you,I think I didn’t explain very well,I found a clue,and I’ll reply with my solution soon.
Regards,
Nabil