Hide Profile Field Groups in BuddyPress

This is a quick introduction to a new plugin I just released on WordPress called BuddyPress Conditional Field Groups. This plugin enables site administrators to show/hide BuddyPress profile field groups to users based on user role.

The intended application is for sites with a diverse user base that may want to collect and display different sets of information based on the user type.

Here is a demo:

BCFG

 

Let me know if you have any questions or requests.

 

10 comments

  1. Andres says:

    I sent you a message a minute ago about this plug in, but i’m not sure if the Contact form works.

    So I’m using your WordPress Plugin “BuddyPress Conditional Field Groups” and is working great!

    Is there a way you can add the ability to the plugin to clear the fields and check-boxes when the Condition is fulfilled? In my case, since the field/check-box is hidden but was previously filled/check, it’s data continues to appear in the search engine and user/member filter. The whole idea is that if a user is demoted from Author to Subscriber, the field hides (like your Plug-In does) and that data gets clear.

    Please let me know if you need further explanation of my inquiry.

    Thank you for your time !

    • tanner says:

      Unfortunately there is no way to do this automatically without some custom code. If you want to code this, you can hook into

       set_user_role

      , loop through all of the hidden field groups and set their values to zero. Let me know if this is something you’d like to try and I’ll see about putting a code snippet together.

      • Andres says:

        Hi,

        Thank you for replying. Yes, is something I would like to try! What I basically need is what you said: set values of every field/checkbox to zero when their group hides using your Plug in. This way filters an search engines wont see their value.

          • Andres says:

            Hi Tanner. Thanks so much for your reply!

            I installed a plugin called, “Custom Functions” to add what you wrote. Since I don’t know anything about programing, do you thing this plugin would work? If not, how do I add the function to your plugin?

            Anyway, when you say “Define the user we are working on. if ( ! $user_id ) {“, the user ID in my case is a Subscriber. Is the id Subscriber or WordPress has an specific ID for that user role? Thank you for your time !

          • tanner says:

            hrm… honestly I don’t feel very comfortable with you using that code if you aren’t a developer. I haven’t tested it and I’d want to look at your setup before advising you to add custom code to the site. If you would like to hire me for a few hours I could get this all setup, but I unfortunately won’t have any time to dedicate here for a few weeks unless it’s billable.

  2. bgrated says:

    For some reason when we tried this program only two groups called (basic & admin) actually worked. Was very disappointed. We have a lot of member groups already implemented before hand. 🙁

Leave a Reply