Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'bp_get_displayed_user_nav'

Viewing 25 results - 26 through 50 (of 96 total)
  • Author
    Search Results
  • r-a-y
    Keymaster

    You’ll want to take a look at the bp_get_displayed_user_nav() function.

    There’s a filter there that applies to each menu item, which you can hook into and override.

    Tammie Lister
    Moderator
    leethompson
    Member

    This is a great post but what about moving sub links to a new parent item, this kinda works but if I remove the parent item the function stops. in my themes functions.php

    `function remove_blogs_nav() {
    bp_core_remove_nav_item( ‘privacy’ );
    bp_core_remove_nav_item( ‘settings’ );
    bp_core_remove_nav_item( ‘invite-anyone’ );
    }
    add_action( ‘bp_setup_nav’, ‘remove_blogs_nav’, 15 );

    function bp_add_create_group_subnav() {
    global $bp;
    $groups_link = ‘/groups-2/’;
    $settings_link = $bp->loggedin_user->domain ;

    /* Add the subnav items to the groups nav item */
    if (function_exists(‘bp_core_new_subnav_item’)) {
    bp_core_new_subnav_item( array(
    ‘name’ => __( ‘Create Clan’, ‘buddypress’ ),
    ‘slug’ => ‘create’,
    ‘parent_url’ => $groups_link,
    ‘parent_slug’ => $bp->groups->slug,
    ‘screen_function’ => ‘groups_screen_group_home’,
    ‘position’ => 40,
    ‘item_css_id’ => ‘home’ ) );

    bp_core_new_subnav_item( array(
    ‘name’ => __( ‘Settings’, ‘buddypress’ ),
    ‘slug’ => ‘settings’,
    ‘parent_url’ => $settings_link,
    ‘parent_slug’ => $bp->profile->slug,
    ‘screen_function’ => ‘profile-settings’,
    ‘position’ => 30,
    ‘item_css_id’ => ‘profile-settings’ ) );

    bp_core_new_subnav_item( array(
    ‘name’ => __( ‘Privacy’, ‘buddypress’ ),
    ‘slug’ => ‘privacy’,
    ‘parent_url’ => $settings_link,
    ‘parent_slug’ => $bp->profile->slug,
    ‘screen_function’ => ‘profile-privacy’,
    ‘position’ => 30,
    ‘item_css_id’ => ‘profile-privacy’ ) );

    }
    }
    add_action(‘bp_setup_nav’, ‘bp_add_create_group_subnav’);
    `
    If I comment out :
    `// bp_core_remove_nav_item( ‘privacy’ );
    // bp_core_remove_nav_item( ‘settings’ );`

    The sub links are in the Profile item, and functional, but still link to each original man item.

    thanks Boone you are a lot of help

    r-a-y
    Keymaster

    You’d need to get rid of `bp_get_displayed_user_nav()` and `bp_get_options_nav()` from your BP templates specifically in the /members/single/ folder of your theme.

    #120403
    exceil
    Member

    p.s im quite noob in programming :D

    #120402
    exceil
    Member

    Hi !
    I want to do the same thing what you defunctlif but i have a problem. I created bp-custom.php file with your settings and put it in buddypress main directory and it doesn’t work :( should i put it somewhere else?

    AlexKalopsia
    Member

    Sorry, looks like I made triple thread -.-

    Nahum
    Participant

    @r-a-y thanks…I’ve been doing alot of display:none! Lately.

    r-a-y
    Keymaster

    @nahummadrid – This is a known bug. Using bp_core_remove_nav_item() will remove access to those pages as well. Right now, I’d suggest hiding the nav item via CSS or by hacking the $bp global to remove the item.

    Nahum
    Participant

    `function boone_remove_groups_nav() {
    bp_core_remove_nav_item( ‘groups’ );
    }
    add_action( ‘bp_setup_nav’, ‘boone_remove_groups_nav’, 15 );
    `
    When I put in functions it doesn’t work at all. The only way i get this to work is putting it in the BP-Custom but then it cuts off all access to groups and forum subpages….can’t figure why

    #107545

    I’ve made some headway but still need help if anyone is able…

    I’ve been editing the CSS of my child theme to simply set the display property of the items I want to omit (eg ‘blogs’) to ‘none’ so that they do not show up.

    I have also used this to add the logged-in-user-specific links I want to my navigation bar:

    <li><a href="#"></a>
    <ul>
    
    </ul>
    </li>

    which now displays. I don’t have fine control over it, eg changing the text or altering the order, though I can live with that. But, my CSS trick of locating the element’s id and setting its display property to none doesn’t work in my drop-down menu.

    It seems as if I need to actually have bp_get_displayed_user_nav() return a different list than it does by default.

    Any ideas?

    Thanks!

    #107526

    Partly answering my own question, from the default buddypress theme I’ve found that the navigation strip is generated by this bit of code:

    <div class="item-list-tabs no-ajax" id="object-nav">
    <ul>
    
    </ul>
    </div>

    Could someone explain a little about how this works? I’ve located bp_get_displayed_user_nav() in the bp-core-templatetags file. I’m not sure about the next line.

    Thanks!

    I tried the solution posted here https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-remove-and-add-items-in-bp_get_displayed_user_nav#post-71009 and it is not working for me. Is it possible that the code changed with the recent update (I think it was 1.2.8)?

    I could really use some help here.

    Thanks in advance.

    imjscn
    Participant

    Last year Boone’s code worked (I used it in bp-custom.php), now, after several BP upgrades, it generate error message.
    Currently, I get erro of “in ……/plugins/invite-anyone/by-email/by-email.php on line 390”

    #105425
    pcwriter
    Participant

    @jordynn

    To remove the notifications subnav item, add the following snippet to your functions.php file:

    `function remove_notifications_subnav(){
    global $bp;
    if ( $bp->current_component == $bp->settings->slug ) {
    bp_core_remove_subnav_item($bp->settings->slug, ‘notifications’);
    }
    }
    add_action( ‘wp’, ‘remove_notifications_subnav’, 2 );`

    This is a simple function taken from this post by @mariochampion
    https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-remove-and-add-items-in-bp_get_displayed_user_nav/?topic_page=2&num=15#post-71265

    Hope this helps! :-)

    #105033
    modemlooper
    Moderator

    has_members()
    next_member()
    rewind_members()
    members()
    the_member()
    bp_rewind_members()
    bp_has_members( $args = ” )
    ‘type’ => $type,
    ‘page’ => $page,
    ‘per_page’ => 20,
    ‘max’ => false,
    ‘include’ => false, // Pass a user_id or comma separated list of user_ids to only show these users
    ‘user_id’ => $user_id, // Pass a user_id to only show friends of this user
    ‘search_terms’ => $search_terms, // Pass search_terms to filter users by their profile data
    ‘populate_extras’ => true // Fetch usermeta? Friend count, last active etc.

    bp_the_member()
    bp_members()
    //Misc
    bp_members_pagination_count()
    bp_members_pagination_links()
    bp_member_user_id()
    bp_get_member_user_id()
    bp_member_user_nicename()
    bp_get_member_user_nicename()
    bp_member_user_login()
    bp_get_member_user_login()
    bp_member_user_email()
    bp_get_member_user_email()
    bp_member_is_loggedin_user()
    bp_member_avatar( $args = ” )
    bp_get_member_avatar( $args = ” )
    ‘type’ => ‘thumb’,
    ‘width’ => false,
    ‘height’ => false,
    ‘class’ => ‘avatar’,
    ‘id’ => false,
    ‘alt’ => __( ‘Member avatar’, ‘buddypress’ )

    bp_member_permalink()
    bp_member_link()
    bp_get_member_link()
    bp_member_name()
    bp_get_member_name()
    bp_member_last_active()
    bp_get_member_last_active()
    bp_member_latest_update( $args = ” )
    bp_get_member_latest_update( $args = ” ) {
    ‘length’ => 15

    bp_member_profile_data( $args = ” )
    ‘field’ => false, // Field name
    bp_member_registered()
    bp_get_member_registered()
    bp_member_add_friend_button()
    bp_add_friend_button( $members_template->member->id, $friend_status )
    bp_member_total_friend_count()
    bp_get_member_total_friend_count()
    bp_member_random_profile_data()
    bp_member_hidden_fields()
    bp_directory_members_search_form()
    bp_total_site_member_count()
    bp_get_total_site_member_count()
    //Check bp-core-templatetags.php for comments about nav tags
    bp_get_loggedin_user_nav()
    bp_get_displayed_user_nav()
    bp_get_options_nav()
    bp_get_options_title()
    //Avatar Tags
    bp_has_options_avatar()
    bp_get_options_avatar()
    bp_comment_author_avatar()
    bp_post_author_avatar()
    bp_loggedin_user_avatar( $args = ” )
    bp_get_loggedin_user_avatar( $args = ” ) {
    ‘type’=> ‘thumb’,
    ‘width’=> false,
    ‘height’=> false,
    ‘html’=> true

    bp_displayed_user_avatar( $args = ” )
    bp_get_displayed_user_avatar( $args = ” )
    ‘type’=> ‘thumb’,
    ‘width’=> false,
    ‘height’=> false,
    ‘html’=> true

    bp_avatar_admin_step()
    bp_get_avatar_admin_step()
    bp_avatar_to_crop()
    bp_get_avatar_to_crop()
    bp_avatar_to_crop_src()
    bp_get_avatar_to_crop_src()
    bp_avatar_cropper()
    //Other
    bp_site_name()
    bp_core_get_wp_profile()
    bp_get_profile_header()
    bp_exists( $component_name )
    bp_format_time( $time, $just_date = false )
    bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true )
    bp_your_or_their( $capitalize = true, $echo = true )
    bp_get_plugin_sidebar()
    bp_page_title()
    bp_get_page_title()
    bp_styles()
    bp_has_custom_signup_page()
    bp_signup_page()
    bp_get_signup_page()
    bp_has_custom_activation_page()
    bp_activation_page()
    bp_get_activation_page()
    bp_search_form_enabled()
    bp_search_form_action()
    bp_search_form_type_select()
    bp_search_form()
    bp_log_out_link()
    bp_custom_profile_boxes()
    bp_custom_profile_sidebar_boxes()
    bp_create_excerpt( $text, $excerpt_length = 55, $filter_shortcodes = true )
    bp_is_serialized( $data )
    bp_total_member_count()
    bp_get_total_member_count()
    bp_signup_username_value()
    bp_get_signup_username_value()
    bp_signup_email_value()
    bp_get_signup_email_value()
    bp_signup_with_blog_value()
    bp_get_signup_with_blog_value()
    bp_signup_blog_url_value()
    bp_get_signup_blog_url_value()
    bp_signup_blog_title_value()
    bp_get_signup_blog_title_value()
    bp_signup_blog_privacy_value()
    bp_get_signup_blog_privacy_value()
    bp_signup_avatar_dir_value()
    bp_get_signup_avatar_dir_value()
    bp_current_signup_step()
    bp_get_current_signup_step()
    bp_signup_avatar( $args = ” )
    bp_get_signup_avatar( $args = ” ) {
    ‘size’ => BP_AVATAR_FULL_WIDTH,
    ‘class’ => ‘avatar’,
    ‘alt’ => __( ‘Your Avatar’, ‘buddypress’ )
    bp_signup_allowed()
    bp_get_signup_allowed()
    bp_blog_signup_allowed()
    bp_get_blog_signup_allowed()
    bp_account_was_activated()
    bp_registration_needs_activation()
    bp_mentioned_user_display_name( $user_id_or_username )
    bp_get_mentioned_user_display_name( $user_id_or_username )
    bp_get_option( $option_name )
    bp_ajax_querystring( $object = false )
    bp_last_activity( $user_id = false, $echo = true )
    bp_user_has_access()
    bp_user_firstname()
    bp_get_user_firstname()
    bp_loggedin_user_link()
    bp_get_loggedin_user_link()
    bp_loggedinuser_link()
    bp_displayed_user_link()
    bp_get_displayed_user_link()
    bp_user_link()
    bp_displayed_user_id()
    bp_current_user_id()
    bp_loggedin_user_id()
    bp_displayed_user_domain()
    bp_loggedin_user_domain()
    bp_displayed_user_fullname()
    bp_get_displayed_user_fullname()
    bp_user_fullname() { echo bp_get_displayed_user_fullname()
    bp_loggedin_user_fullname()
    bp_get_loggedin_user_fullname()
    bp_displayed_user_username()
    bp_get_displayed_user_username()
    bp_loggedin_user_username()
    bp_get_loggedin_user_username()
    bp_current_component()
    bp_current_action()
    bp_current_item()
    bp_action_variables()
    bp_root_domain()
    bp_get_root_domain()
    //Conditionals
    bp_is_blog_page()
    bp_is_my_profile()
    bp_is_home()
    bp_is_front_page()
    bp_is_activity_front_page()
    bp_is_directory()
    bp_is_page($page)
    bp_is_active( $component )
    bp_is_profile_component()
    bp_is_activity_component()
    bp_is_blogs_component()
    bp_is_messages_component()
    bp_is_friends_component()
    bp_is_groups_component()
    bp_is_settings_component()
    bp_is_member()
    bp_is_user_activity()
    bp_is_user_friends_activity()
    bp_is_activity_permalink()
    bp_is_user_profile()
    bp_is_profile_edit()
    bp_is_change_avatar()
    bp_is_user_groups()
    bp_is_group()
    bp_is_group_home()
    bp_is_group_create()
    bp_is_group_admin_page()
    bp_is_group_forum()
    bp_is_group_activity()
    bp_is_group_forum_topic()
    bp_is_group_forum_topic_edit()
    bp_is_group_members()
    bp_is_group_invites()
    bp_is_group_membership_request()
    bp_is_group_leave()
    bp_is_group_single()
    bp_is_user_blogs()
    bp_is_user_recent_posts()
    bp_is_user_recent_commments()
    bp_is_create_blog()
    bp_is_user_friends()
    bp_is_friend_requests()
    bp_is_user_messages()
    bp_is_messages_inbox()
    bp_is_messages_sentbox()
    bp_is_notices()
    bp_is_messages_compose_screen()
    bp_is_single_item()
    bp_is_activation_page()
    bp_is_register_page()
    bp_the_body_class()
    bp_get_the_body_class( $wp_classes, $custom_classes = false )

    #98397
    Justin Frydman
    Participant

    Hey guys,

    Regarding @nuprn1 post, bp_get_displayed_user_nav() is not displaying any tabs on this custom page.

    Any ideas?

    Roger Coathup
    Participant

    @boonebgorges – given the bug fix / re-engineering is scheduled for 1.3, I’m guessing the best short term workaround is to hard code our own bespoke user nav

    Paul Wong-Gibbs
    Keymaster

    It is a bug, we have a ticket: https://trac.buddypress.org/ticket/2644

    Patrik
    Participant

    @youngmicroserf I’m having the same issue with the example that @mariochampion provided.

    mariochampion or anyone else who knows; it would be very helpfull if you could tell what to change. I assume it’s the xprofile.php file we should copy and edit since I can’t find a file named xprofile-setting.php.

    sebastian
    Participant

    I have found a solution.

    This did what I wanted:
    https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-remove-and-add-items-in-bp_get_displayed_user_nav#post-71009

    all I had to add was:
    if (! is_user_logged_in)

    Thanks!

    #93042
    youngmicroserf
    Participant

    I’m bumping this because the @-mention above didn’t work, apparently.

    @boonebgorges,

    for some reason, your suggested solution doesn’t work. I suppose it has to do with the hook, but using bp_core_remove_nav_item(‘groups’) doesn’t work at ‘bp_setup_nav’, while it does work at the point @mariochampion suggested.

    Here’s a problem, though, in my installation, when I remove the nav link, I am no longer able to access group pages. I can access the group directory and groups will be displayed there, but clicking on a group will take me to the front page. Is this a bug? It seems like it, since the function is supposed to only remove the navigation item, not access to the feature, am I right? Or am I not getting something? Is there a better way to remove the navigation item?

    #92986
    youngmicroserf
    Participant

    Hmm. Is this the intended effect? I removed the “groups” element from the navigation bar on the profile using the bp_core_remove_nav_item-function, but after doing that I was no longer able to access any group and after directly entering the group’s URL I will be redirected to the homepage. Is there any way to remove items from the *navigation* but keep them available for direct access? Bizarrely, I am able to display the groups directory page when the bp_core_remove_nav_item(‘groups’)-function is active, but not individual group homepages. Clicking on a group name will take me to the homepage.

    Are there other options for menu item removal?

    Thanks!

    #92984
    youngmicroserf
    Participant

    @Boone Gorges,

    using bp_core_remove_nav_item( ‘blogs’ ) at bp_setup_nav didn’t work for me. But putting it in mariochampions function right after “global $bp” did – any idea why?

    @mariochampion,

    sorry, but I’m new to BP, and I can’t find the xprofile-settings.php you’re referring to above – could you give me a hand? Could you also indicate where you changed the slugs in the copied file?

    Thanks!

    #92908
    Roger Coathup
    Participant
Viewing 25 results - 26 through 50 (of 96 total)
Skip to toolbar