1

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

9
+50

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.

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