fixes not allowed size parameter for any input types, which do not al… (#50438)

* fixes not allowed size parameter for any input types, which do not allow them

* add changelog

* Update plugins/woocommerce/templates/global/quantity-input.php

* Appease linter

---------

Co-authored-by: Lukas Kurzmann <lukas.kurzmann@sunlime.at>
Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
Co-authored-by: Jorge Torres <jorge.torres@automattic.com>
This commit is contained in:
Lukas Kurzmann 2024-08-28 18:00:45 +02:00 committed by GitHub
parent 0aae5fd859
commit ccc5042ce9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: Fixes a warning that only shows up when validating page content

View File

@ -12,7 +12,7 @@
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates
* @version 7.8.0
* @version 9.4.0
*
* @var bool $readonly If the input should be set to readonly mode.
* @var string $type The input type attribute.
@ -42,7 +42,9 @@ $label = ! empty( $args['product_name'] ) ? sprintf( esc_html__( '%s quantity',
name="<?php echo esc_attr( $input_name ); ?>"
value="<?php echo esc_attr( $input_value ); ?>"
aria-label="<?php esc_attr_e( 'Product quantity', 'woocommerce' ); ?>"
size="4"
<?php if ( in_array( $type, array( 'text', 'search', 'tel', 'url', 'email', 'password' ), true ) ) : ?>
size="4"
<?php endif; ?>
min="<?php echo esc_attr( $min_value ); ?>"
max="<?php echo esc_attr( 0 < $max_value ? $max_value : '' ); ?>"
<?php if ( ! $readonly ) : ?>