New Plugin Adds Conditional Profile Fields to BuddyPress

photo credit: Dunechaser - cc
photo credit: Dunechasercc

When you create profile fields in BuddyPress, they apply to every user in the same way. Each user responds to the same set of questions, but this could stand to be a little more flexible to account for differences in users. What if you could conditionally show profile fields, based on a user’s answers to certain questions?

Prolific BuddyPress plugin developer Brajesh Singh created a plugin to do exactly this. Conditional Profile Fields for BuddyPress gives site administrators the ability to set conditions for hiding/showing profile fields based on a user’s responses to other profile fields. For example, let’s say you create a field to ask if the user is a morning or night person.

profile-field

You can then set up a second question, such as “Do you eat breakfast?” With the help of this plugin, you can make the question contingent on the first question where you asked if the person is a morning or night person. Perhaps you are curious if a user who identifies as a “night person” also eats breakfast. While editing the breakfast question, scroll to the bottom and you will find a new box for setting a Visibility Condition.

From the dropdown, select the question you want as the condition, show/hide, and the value that field is contingent upon. The plugin also includes support for muti-option fields.

conditions

Once you have your condition set, you can navigate to the frontend to see that the conditional fields are shown or hidden based on your selection. Here’s a quick demo:

conditional-profile-fields-demo

If you mark the first profile field as “Required” when creating it, then BuddyPress will also show the field on the registration form and conditional fields will also apply. The plugin currently supports the following features:

  • Compatible with 99% of WordPress themes
  • 2 visibility options to either show the field or hide the field based on the condition
  • A field dropdown box to allow you to select the field that governs the display of this field
  • 6 operators to match the values (6 operators for the number/text/textarea field and 2 operators for matching the multi-select box/check box/radio)
  • It supports the multi-type field as well as other fields (and should support custom profile fields automatically)
  • Currently the date field is not supported for creating conditions

The Conditional Profile Fields plugin is an excellent addition to any BuddyPress site that brings together different types of users. For example, educational sites might include students, teachers, tutors, etc. Instead of using a complicated plugin to set up different user types, you can add a conditional profile field to ask the user to select from student, teacher, etc. From there you can create different profile field groups containing questions conditional upon the user’s previous selection.

Conditional profile fields could also be useful for many other types of social networks, including:

  • Dating sites
  • Professional organizations
  • Sports teams
  • Multilingual communities
  • Job or freelancer networks
  • Hobby or interest-based networks

I tested the plugin with BuddyPress 2.1 beta 1 and found that it works exactly as advertised. Conditional profile fields are an excellent way to extend a niche social network to display profile fields specifically tailored to different user types. Download Conditional Profile Fields for BuddyPress for free from BuddyDev.com.

7

7 responses to “New Plugin Adds Conditional Profile Fields to BuddyPress”

      • Hi Brajesh Singh,

        Thank you for your fast reaction. It shows a professional care, which I appreciate very much.
        When it comes to my site and your plugin, I found out that the error is a user error, being not a native English speaker I misunderstood some of the settings. Now that I am a little wiser ( and applied the correct settings…) everything works like it should.
        So thank you again for your fast reply, I am sorry that I did not look any better before posting the message above and I recommend Conditional Profile Fields for BuddyPress to everybody who needs this kind of plugin.

  1. Have an issue with “Number of kids” field that I am using. If user selects 1 child then it is no problem as it will show 1 “First Name” field – plugin works fine. Problem is if say the user selects 3 children. This plugin only allows 1 condition, so how do you show 3 “First Name” fields? Also even with 1 condition it only allows = or not equal sign, there is no > 2. I hope you can understand what I am saying…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Discover more from WP Tavern

Subscribe now to keep reading and get access to the full archive.

Continue reading