WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In BuddyPress, What is the use of is_default_option field in wp_bp_xprofile_fields table?

share|improve this question

closed as off-topic by toscho Aug 2 '14 at 20:55

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 9 down vote accepted

This is one of the things you won't find in the docs, but only in the source. The source code contains only one usage of this variable. This is in bp-xprofile-template.php line 493.

              // First, check to see whether the user-entered value matches
              if ( in_array( $allowed_options, (array) $option_values ) ) {
                  $selected = ' selected="selected"';

              // Then, if the user has not provided a value, check for defaults
              if ( !is_array( $original_option_values ) && empty( $option_values ) && $options[$k]->is_default_option ) {
                  $selected = ' selected="selected"';

As you can see, it is used to pre-select an option in the case the user hasn't supplied a value yet.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.