Skip to content

Commit

Permalink
Fix bug when creating a new mapping and then selecting the gc status …
Browse files Browse the repository at this point in the history
…before saving
  • Loading branch information
jtsternberg committed Jul 29, 2016
1 parent ac46851 commit 6f5f508
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
</td>
<td>
<select class="gc-default-mapping-select" data-column="post_status_mapping" name="<?php $this->output( 'option_base' ); ?>[gc_status][<?php echo esc_attr( $status->id ); ?>][wp]">
<option <# if ( ! data.gc_status[<?php echo esc_attr( $status->id ); ?>].wp ) { #>selected="selected"<# } #> value=""><?php _e( 'Use Default Status' ); ?></option>
<option <# if ( ! data.gc_status[<?php echo esc_attr( $status->id ); ?>] || ! data.gc_status[<?php echo esc_attr( $status->id ); ?>].wp ) { #>selected="selected"<# } #> value=""><?php _e( 'Use Default Status' ); ?></option>
<?php foreach ( $this->get( 'post_status_options' ) as $option_val => $option_label ) : ?>
<option <# if ( '<?php echo $option_val; ?>' == data.gc_status[<?php echo esc_attr( $status->id ); ?>].wp ) { #>selected="selected"<# } #> value="<?php echo $option_val; ?>"><?php echo $option_label; ?></option>
<option <# if ( data.gc_status[<?php echo esc_attr( $status->id ); ?>] && data.gc_status[<?php echo esc_attr( $status->id ); ?>].wp && '<?php echo $option_val; ?>' == data.gc_status[<?php echo esc_attr( $status->id ); ?>].wp ) { #>selected="selected"<# } #> value="<?php echo $option_val; ?>"><?php echo $option_label; ?></option>
<?php endforeach; ?>
</select>
</td>
<td>
<select class="gc-default-mapping-select gc-select2" data-column="gc_status" name="<?php $this->output( 'option_base' ); ?>[gc_status][<?php echo esc_attr( $status->id ); ?>][after]"">
<option <# if ( ! data.gc_status[<?php echo esc_attr( $status->id ); ?>].after ) { #>selected="selected"<# } #> value=""><?php _e( 'Do not change' ); ?></option>
<option <# if ( ! data.gc_status[<?php echo esc_attr( $status->id ); ?>] || ! data.gc_status[<?php echo esc_attr( $status->id ); ?>].after ) { #>selected="selected"<# } #> value=""><?php _e( 'Do not change' ); ?></option>
<?php foreach ( $this->get( 'gc_status_options' ) as $status2 ) : ?>
<option data-color="<?php echo esc_attr( $status2->color ); ?>" data-description="<?php echo esc_attr( $status2->description ); ?>" <# if ( '<?php echo esc_attr( $status2->id ); ?>' == data.gc_status[<?php echo esc_attr( $status->id ); ?>].after ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $status2->id ); ?>"><?php echo esc_attr( $status2->name ); ?></option>
<option data-color="<?php echo esc_attr( $status2->color ); ?>" data-description="<?php echo esc_attr( $status2->description ); ?>" <# if ( data.gc_status[<?php echo esc_attr( $status->id ); ?>] && data.gc_status[<?php echo esc_attr( $status->id ); ?>].after && '<?php echo esc_attr( $status2->id ); ?>' == data.gc_status[<?php echo esc_attr( $status->id ); ?>].after ) { #>selected="selected"<# } #> value="<?php echo esc_attr( $status2->id ); ?>"><?php echo esc_attr( $status2->name ); ?></option>
<?php endforeach; ?>
</select>
</td>
Expand Down

0 comments on commit 6f5f508

Please sign in to comment.