This topic has 4 replies, 2 voices, and was last updated 9 years by Parkproductions.
-
Author
-
March 25, 2015 at 04:08 #51430ParkproductionsParticipant
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 );March 26, 2015 at 17:44 #51683sharmstrModeratortry 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 26, 2015 at 17:45 #51684sharmstrModeratorSorry, 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 26, 2015 at 17:50 #51687sharmstrModeratorThe 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.