Changeset 2831 for branches/1.2/bp-xprofile/bp-xprofile-templatetags.php
- Timestamp:
- 03/11/2010 11:41:31 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-xprofile/bp-xprofile-templatetags.php
r2695 r2831 345 345 global $field; 346 346 347 return apply_filters( 'bp_get_the_profile_field_input_name', 'field_' . $field->id ); 347 $array_box = false; 348 if ( 'multiselectbox' == $field->type ) 349 $array_box = '[]'; 350 351 return apply_filters( 'bp_get_the_profile_field_input_name', 'field_' . $field->id . $array_box ); 348 352 } 349 353 … … 373 377 374 378 for ( $k = 0; $k < count($options); $k++ ) { 375 $option_value = BP_XProfile_ProfileData::get_value_byid($options[$k]->parent_id); 379 $option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $options[$k]->parent_id ) ); 380 $option_values = (array)$option_values; 376 381 377 382 /* Check for updated posted values, but errors preventing them from being saved first time */ 378 if ( isset( $_POST['field_' . $field->id] ) && $option_value != $_POST['field_' . $field->id] ) { 379 if ( !empty( $_POST['field_' . $field->id] ) ) 380 $option_value = $_POST['field_' . $field->id]; 383 foreach( (array)$option_values as $i => $option_value ) { 384 if ( isset( $_POST['field_' . $field->id] ) && $_POST['field_' . $field->id] != $option_value ) { 385 if ( !empty( $_POST['field_' . $field->id] ) ) 386 $option_values[$i] = $_POST['field_' . $field->id]; 387 } 381 388 } 382 389 383 if ( $option_value == $options[$k]->name|| $options[$k]->is_default_option ) {390 if ( in_array( $options[$k]->name, (array)$option_values ) || $options[$k]->is_default_option ) { 384 391 $selected = ' selected="selected"'; 385 392 } else {
Note: See TracChangeset
for help on using the changeset viewer.