Merge pull request #22333 from Prospress/fix/21607

fix W3C validation errors in quantity-input.php template
This commit is contained in:
Mike Jolley 2019-01-09 11:26:48 +00:00 committed by GitHub
commit 127965419b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -25,7 +25,7 @@ if ( $max_value && $min_value === $max_value ) {
<?php
} else {
/* translators: %s: Quantity. */
$labelledby = ! empty( $args['product_name'] ) ? sprintf( __( '%s quantity', 'woocommerce' ), strip_tags( $args['product_name'] ) ) : '';
$labelledby = ! empty( $args['product_name'] ) ? sprintf( __( '%s quantity', 'woocommerce' ), wp_strip_all_tags( $args['product_name'] ) ) : '';
?>
<div class="quantity">
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?></label>
@ -40,9 +40,10 @@ if ( $max_value && $min_value === $max_value ) {
value="<?php echo esc_attr( $input_value ); ?>"
title="<?php echo esc_attr_x( 'Qty', 'Product quantity input tooltip', 'woocommerce' ); ?>"
size="4"
pattern="<?php echo esc_attr( $pattern ); ?>"
inputmode="<?php echo esc_attr( $inputmode ); ?>"
<?php if ( ! empty( $labelledby ) ) { ?>
aria-labelledby="<?php echo esc_attr( $labelledby ); ?>" />
<?php } ?>
</div>
<?php
}