Changeset 2842 for trunk/bp-xprofile/bp-xprofile-templatetags.php
- Timestamp:
- 03/12/2010 01:03:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-templatetags.php
r2810 r2842 343 343 global $field; 344 344 345 return apply_filters( 'bp_get_the_profile_field_input_name', 'field_' . $field->id ); 345 $array_box = false; 346 if ( 'multiselectbox' == $field->type ) 347 $array_box = '[]'; 348 349 return apply_filters( 'bp_get_the_profile_field_input_name', 'field_' . $field->id . $array_box ); 346 350 } 347 351 … … 370 374 $html .= '<option value="">--------</option>'; 371 375 372 for ( $k = 0; $k < count( $options ); $k++ ) { 373 $option_value = BP_XProfile_ProfileData::get_value_byid( $options[$k]->parent_id ); 376 for ( $k = 0; $k < count($options); $k++ ) { 377 $option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $options[$k]->parent_id ) ); 378 $option_values = (array)$option_values; 374 379 375 380 /* Check for updated posted values, but errors preventing them from being saved first time */ 376 if ( isset( $_POST['field_' . $field->id] ) && $option_value != $_POST['field_' . $field->id] ) { 377 if ( !empty( $_POST['field_' . $field->id] ) ) 378 $option_value = $_POST['field_' . $field->id]; 381 foreach( (array)$option_values as $i => $option_value ) { 382 if ( isset( $_POST['field_' . $field->id] ) && $_POST['field_' . $field->id] != $option_value ) { 383 if ( !empty( $_POST['field_' . $field->id] ) ) 384 $option_values[$i] = $_POST['field_' . $field->id]; 385 } 379 386 } 380 387 381 if ( $option_value == $options[$k]->name|| $options[$k]->is_default_option )388 if ( in_array( $options[$k]->name, (array)$option_values ) || $options[$k]->is_default_option ) 382 389 $selected = ' selected="selected"'; 383 390 else … … 649 656 650 657 /* admin/profile/edit/[group-id] */ 651 return apply_filters( 'bp_get_current_profile_group_id', $profile_group_id ); 658 return apply_filters( 'bp_get_current_profile_group_id', $profile_group_id ); 652 659 } 653 660
Note: See TracChangeset
for help on using the changeset viewer.