Skip to:
Content

BuddyPress.org

Changeset 5552


Ignore:
Timestamp:
12/14/2011 08:09:45 PM (13 years ago)
Author:
boonebgorges
Message:

Adds 'null_on_required' param to bp_get_the_profile_field_options(), which will allow theme authors to display a blank option in a Required dropdown if they wish. Fixes #3698

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-template.php

    r5418 r5552  
    412412
    413413        $defaults = array(
    414             'type' => false
     414            'type'         => false,
     415            'null_on_required' => false // Generally, a required dropdown field will not
     416                            // get a blank value at the top. Set to true if
     417                            // you want this blank value even on
     418                            // required fields
    415419        );
    416420
     
    429433        switch ( $field->type ) {
    430434            case 'selectbox':
    431                 if ( !$field->is_required )
     435                if ( !$field->is_required || $null_on_required )
    432436                    $html .= '<option value="">' . /* translators: no option picked in select box */ __( '----', 'buddypress' ) . '</option>';
    433437
Note: See TracChangeset for help on using the changeset viewer.