Skip to content

Commit

Permalink
'Repeating' does not work properly for Multiselect - fixed issue #184
Browse files Browse the repository at this point in the history
  • Loading branch information
alexxgermann committed Sep 16, 2016
1 parent 3a4a2f2 commit 61ab023
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runway-framework/data-types/multi-select-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function render_content( $vals = null ) {

<option value="no" <?php if(isset($vals[$key][0]) && $vals[$key][0] == 'no') { ?> selected="selected" <?php } ?>><?php echo __('No value', 'runway'); ?></option>
<?php foreach ( $key_values as $select_value_key => $val ) {
if(is_array($vals[$key])) {
if ( array_key_exists( $key, $vals ) && is_array( $vals[ $key ] ) ) {
$checked = ( in_array( $select_value_key, $vals[$key] ) ) ? ' selected="selected" checked="checked"' : '';
}
else
Expand Down Expand Up @@ -319,9 +319,9 @@ class: '<?php echo esc_js($class); ?>',

field.append('<option value="no"><?php echo __('No value', 'runway'); ?></option>');
<?php foreach($default_values as $val_key=>$val) {
$html = '<option value="'.$val_key.'" >'.stripslashes( $val ).'</option>';
$html = '<option value="'. esc_attr( $val_key ) .'" >'. esc_js( stripslashes( $val ) ) .'</option>';
?>
field.append('<?php echo esc_js($html);?>');
field.append('<?php echo $html;?>');
<?php } ?>

field.insertBefore($(this));
Expand Down

0 comments on commit 61ab023

Please sign in to comment.