Merge pull request #4094 from robdvr/master
Ability to add custom input classes
This commit is contained in:
commit
daea1e827c
|
@ -1590,6 +1590,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
|
|||
'required' => false,
|
||||
'class' => array(),
|
||||
'label_class' => array(),
|
||||
'input_class' => array(),
|
||||
'return' => false,
|
||||
'options' => array(),
|
||||
'custom_attributes' => array(),
|
||||
|
@ -1714,7 +1715,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
|
|||
|
||||
if ( $args['label'] )
|
||||
$field .= '<label for="' . esc_attr( $key ) . '" class="' . implode( ' ', $args['label_class'] ) .'">' . $args['label']. $required . '</label>';
|
||||
$field .= '<input type="text" class="input-text" value="' . $value . '" placeholder="' . $args['placeholder'] . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $key ) . '" ' . implode( ' ', $custom_attributes ) . ' />';
|
||||
$field .= '<input type="text" class="input-text ' . implode( ' ', $args['input_class'] ) .'" value="' . $value . '" placeholder="' . $args['placeholder'] . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $key ) . '" ' . implode( ' ', $custom_attributes ) . ' />';
|
||||
$field .= '</p>' . $after;
|
||||
|
||||
}
|
||||
|
@ -1727,7 +1728,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
|
|||
if ( $args['label'] )
|
||||
$field .= '<label for="' . esc_attr( $key ) . '" class="' . implode( ' ', $args['label_class'] ) .'">' . $args['label']. $required . '</label>';
|
||||
|
||||
$field .= '<textarea name="' . esc_attr( $key ) . '" class="input-text" id="' . esc_attr( $key ) . '" placeholder="' . $args['placeholder'] . '"' . ( empty( $args['custom_attributes']['rows'] ) ? ' rows="2"' : '' ) . ( empty( $args['custom_attributes']['cols'] ) ? ' cols="5"' : '' ) . implode( ' ', $custom_attributes ) . '>'. esc_textarea( $value ) .'</textarea>
|
||||
$field .= '<textarea name="' . esc_attr( $key ) . '" class="input-text ' . implode( ' ', $args['input_class'] ) .'" id="' . esc_attr( $key ) . '" placeholder="' . $args['placeholder'] . '"' . ( empty( $args['custom_attributes']['rows'] ) ? ' rows="2"' : '' ) . ( empty( $args['custom_attributes']['cols'] ) ? ' cols="5"' : '' ) . implode( ' ', $custom_attributes ) . '>'. esc_textarea( $value ) .'</textarea>
|
||||
</p>' . $after;
|
||||
|
||||
break;
|
||||
|
@ -1746,7 +1747,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
|
|||
if ( $args['label'] )
|
||||
$field .= '<label for="' . esc_attr( $key ) . '" class="' . implode( ' ', $args['label_class'] ) .'">' . $args['label']. $required . '</label>';
|
||||
|
||||
$field .= '<input type="password" class="input-text" name="' . esc_attr( $key ) . '" id="' . esc_attr( $key ) . '" placeholder="' . $args['placeholder'] . '" value="' . esc_attr( $value ) . '" ' . implode( ' ', $custom_attributes ) . ' />
|
||||
$field .= '<input type="password" class="input-text ' . implode( ' ', $args['input_class'] ) .'" name="' . esc_attr( $key ) . '" id="' . esc_attr( $key ) . '" placeholder="' . $args['placeholder'] . '" value="' . esc_attr( $value ) . '" ' . implode( ' ', $custom_attributes ) . ' />
|
||||
</p>' . $after;
|
||||
|
||||
break;
|
||||
|
@ -1757,7 +1758,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
|
|||
if ( $args['label'] )
|
||||
$field .= '<label for="' . esc_attr( $key ) . '" class="' . implode( ' ', $args['label_class'] ) .'">' . $args['label'] . $required . '</label>';
|
||||
|
||||
$field .= '<input type="text" class="input-text" name="' . esc_attr( $key ) . '" id="' . esc_attr( $key ) . '" placeholder="' . $args['placeholder'] . '" '.$args['maxlength'].' value="' . esc_attr( $value ) . '" ' . implode( ' ', $custom_attributes ) . ' />
|
||||
$field .= '<input type="text" class="input-text ' . implode( ' ', $args['input_class'] ) .'" name="' . esc_attr( $key ) . '" id="' . esc_attr( $key ) . '" placeholder="' . $args['placeholder'] . '" '.$args['maxlength'].' value="' . esc_attr( $value ) . '" ' . implode( ' ', $custom_attributes ) . ' />
|
||||
</p>' . $after;
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue