Select an option vs state

This commit is contained in:
Mike Jolley 2019-02-18 11:49:46 +00:00
parent 4672a47d67
commit afe219d854
2 changed files with 5 additions and 1 deletions

View File

@ -122,6 +122,10 @@ jQuery( function( $ ) {
}
}
if ( ! placeholder ) {
placeholder = wc_country_select_params.i18n_select_state_text;
}
$statebox.closest( 'p.form-row' ).show();
if ( $statebox.is( 'input' ) ) {

View File

@ -2672,7 +2672,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
} elseif ( ! is_null( $for_country ) && is_array( $states ) ) {
$field .= '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="state_select ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" ' . implode( ' ', $custom_attributes ) . ' data-placeholder="' . esc_attr( $args['placeholder'] ) . '">
$field .= '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="state_select ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" ' . implode( ' ', $custom_attributes ) . ' data-placeholder="' . esc_attr( $args['placeholder'] ? $args['placeholder'] : esc_html__( 'Select an option&hellip;', 'woocommerce' ) ) . '">
<option value="">' . esc_html__( 'Select an option&hellip;', 'woocommerce' ) . '</option>';
foreach ( $states as $ckey => $cvalue ) {