This topic has 4 replies, 2 voices, and was last updated 9 years by Parkproductions.

  • Author
  • #51430
     Parkproductions
    Participant

    My issue at the moment is that I need to hide certain xprofile field edit groups based on user type set currently by an xprofile drop down menu.

    Currently we have numerous profile types including Athlete, Coach, Psychologist, Chiropracter etc.

    If a user registers that they are a Coach they still have access (on their profile page) to edit the Athlete xprofile group which is irrelevant.

    I’ve been able to show/hide different main navigation items on my development server and get them to switch depending on which user type they select, however the subnav edit links for other user types still appear.

    Is there a way to hide these depending on usertype. I tried switching the system to be based on roles instead of user type by using plugins BuddyPress xProfiles ACL, WP Roles at Registration and WPFront User Role Editor however it seems they do not work with the latest version of KLEO.

    This is an example of how I switch main buddypress navs using function.php was hoping there was something similar for subnav edit links

    function hide_tab_from_community() {
    $role = xprofile_get_field_data( ‘User Type’ );
    if( $role !=’Coach’ )
    bp_core_remove_nav_item(‘services’);
    }
    add_action( ‘bp_setup_nav’, ‘hide_tab_from_community’, 99 );

    #51683
     sharmstr
    Moderator

    try bp_core_remove_subnav_item

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #51684
     sharmstr
    Moderator

    Sorry, I just read what you wanted again. Give me a sec to get the right answer.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #51687
     sharmstr
    Moderator

    The loop happens in /kleo/buddypress/members/single/profile/profile-loop.php. You’ll have to copy that to your child theme and add your check for user type in the loop. Or ask on the Buddypress forum if there is a way to filter the loop. Kleo only stylizes it so its best to ask the developers about this.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #51784
     Parkproductions
    Participant

    Thanks Sharmstr, always really helpful!

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?