@michaeltransmissions As you noted above, the ticket as been closed as wontfix on the UI but lead dev enabled plugin authors to create custom levels by adding a new filter. I’m sorry that there is no plugin that I know of created for your needs. You’d either have to create one or hire someone to do it for you or wait till someone makes it.
Hi – thank you for the response. You are talking about the bp_xprofile_get_hidden_field_types_for_user filter? Looks like I would have to modify the code in bp-xprofile-functions.php by adding a new level…?
Michael
How will the ‘tags’ be used?
As the basis for filtering members?
Or just as ‘notes’ about each member?
If the former, see the BP_User_Query codex page.
If the latter, you could use this premium plugin: BuddyNotes
Or you could simply create template overloads of these 2 files:
buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.php
buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\edit.php
And check the fields via their id or name and then decide, based on who the logged-in user is, whether the fields should be displayed.
The tags will be used as a filter. For example, to generate a mailing list that is a sub slice of the entire list of site members.
shanebp — I followed your suggestion and it worked like a charm. I also had to add some code to my functions.php file to be able to redirect calls to the WP Profile page to the BP Profile page because editing the the files you suggested didn’t affect restrict the fields on the WP Profile page (code for this below, if anyone wants).
My only question is the following – would changes to the files in the bp-templates directory get overwritten if I update the BP plugin? If so, it would be nice to find an alternative way to do this, but otherwise I just need to know so I can incorporate a restore of the code changes from a backup to my upgrade workflow document for this site.
Thanks,
Michael
add_action ('init' , 'prevent_profile_access');
function prevent_profile_access(){
if (current_user_can('manage_options')) return ''; //if admin, exit
//everyone else, redirect to the bp profile page, not the wp profile page!
if (strpos ($_SERVER ['REQUEST_URI'] , 'wp-admin/profile.php' )){
wp_redirect (bp_loggedin_user_domain());
}
}
would changes to the files in the bp-templates directory get overwritten if I update the BP plugin?
Of course, which is why I suggested you create template overloads instead.
got, thanks for the heads up. the link on overloads explained much. i’m still a newbie re: WordPress and BuddyPress and find that it’s not always easy to get crucial info out of the documentation unless you already know it exists (or are familiar enough with these systems to know what you might be looking for).
Thanks again
it’s not always easy to get crucial info out of the documentation
Very true. And BP docs aren’t at the level of WP docs.
BP codex is being worked on, but it’s a cumbersome process.
If you see an opportunity to improve / amend something, I think participants can still do so.
Or start a topic here with suggestions.