std and selected @a0f2282ebce9776f9805ca3f53e4baba2f8ffd50
This commit is contained in:
parent
a9a5f0ceca
commit
3d290d7f61
|
@ -247,8 +247,12 @@ function woocommerce_admin_fields($options) {
|
||||||
<td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" class="<?php if (isset($value['class'])) echo $value['class']; ?>">
|
<td class="forminp"><select name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" style="<?php echo esc_attr( $value['css'] ); ?>" class="<?php if (isset($value['class'])) echo $value['class']; ?>">
|
||||||
<?php
|
<?php
|
||||||
foreach ($value['options'] as $key => $val) {
|
foreach ($value['options'] as $key => $val) {
|
||||||
|
$_current = get_option( $value['id'] );
|
||||||
|
if ( ! $_current ) {
|
||||||
|
$_current = $value['std'];
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<option value="<?php echo esc_attr( $key ); ?>" <?php if (get_option($value['id']) == $key) { ?> selected="selected" <?php } ?>><?php echo $val ?></option>
|
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $_current, $key ); ?>><?php echo $val ?></option>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue