Merge branch 'pr/8607'

This commit is contained in:
Mike Jolley 2015-07-27 13:17:27 +01:00
commit 2ea6a2efab
3 changed files with 6 additions and 3 deletions

View File

@ -643,7 +643,8 @@ class WC_Meta_Box_Product_Data {
$options = wc_get_text_attributes( $attribute['value'] );
foreach ( $options as $option ) {
echo '<option ' . selected( $variation_selected_value, $option, false ) . ' value="' . esc_attr( $option ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
$selected = sanitize_title( $variation_selected_value ) === $variation_selected_value ? selected( sanitize_title( $variation_selected_value ), sanitize_title( $option ), false ) : selected( $variation_selected_value, $option, false );
echo '<option ' . $selected . ' value="' . esc_attr( $option ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
}
}

View File

@ -45,7 +45,8 @@ extract( $variation_data );
$options = wc_get_text_attributes( $attribute['value'] );
foreach ( $options as $option ) {
echo '<option ' . selected( $variation_selected_value, $option, false ) . ' value="' . esc_attr( $option ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
$selected = sanitize_title( $variation_selected_value ) === $variation_selected_value ? selected( sanitize_title( $variation_selected_value ), sanitize_title( $option ), false ) : selected( $variation_selected_value, $option, false );
echo '<option ' . $selected . ' value="' . esc_attr( $option ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
}
}

View File

@ -53,7 +53,8 @@ global $product, $post;
} else {
foreach ( $options as $option ) {
echo '<option value="' . esc_attr( $option ) . '" ' . selected( $selected_value, $option, false ) . '>' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
$selected = sanitize_title( $selected_value ) === $selected_value ? selected( sanitize_title( $selected_value ), sanitize_title( $option ), false ) : selected( $selected_value, $option, false );
echo '<option value="' . esc_attr( $option ) . '" ' . $selected . '>' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
}
}
}