Bump template versions and fix coding standards

This commit is contained in:
Claudio Sanches 2020-02-04 14:16:07 -03:00
parent e0ee96cd37
commit 107995ab9a
2 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,7 @@
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.10.0
* @version 4.0.0
*/
defined( 'ABSPATH' ) || exit;

View File

@ -10,9 +10,9 @@
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.10.0
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 4.0.0
*/
defined( 'ABSPATH' ) || exit;
@ -42,7 +42,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
foreach ( $grouped_products as $grouped_product_child ) {
$post_object = get_post( $grouped_product_child->get_id() );
$quantites_required = $quantites_required || ( $grouped_product_child->is_purchasable() && ! $grouped_product_child->has_options() );
$post = $post_object; // WPCS: override ok.
$post = $post_object; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
setup_postdata( $post );
echo '<tr id="product-' . esc_attr( $grouped_product_child->get_id() ) . '" class="woocommerce-grouped-product-list-item ' . esc_attr( implode( ' ', wc_get_product_class( '', $grouped_product_child ) ) ) . '">';
@ -65,7 +65,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
woocommerce_quantity_input(
array(
'input_name' => 'quantity[' . $grouped_product_child->get_id() . ']',
'input_value' => isset( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ? wc_stock_amount( wc_clean( wp_unslash( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ) ) : '', // WPCS: CSRF ok, input var okay, sanitization ok.
'input_value' => isset( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ? wc_stock_amount( wc_clean( wp_unslash( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ) ) : '', // phpcs:ignore WordPress.Security.NonceVerification.Missing
'min_value' => apply_filters( 'woocommerce_quantity_input_min', 0, $grouped_product_child ),
'max_value' => apply_filters( 'woocommerce_quantity_input_max', $grouped_product_child->get_max_purchase_quantity(), $grouped_product_child ),
'placeholder' => '0',
@ -90,14 +90,14 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
break;
}
echo '<td class="woocommerce-grouped-product-list-item__' . esc_attr( $column_id ) . '">' . apply_filters( 'woocommerce_grouped_product_list_column_' . $column_id, $value, $grouped_product_child ) . '</td>'; // WPCS: XSS ok.
echo '<td class="woocommerce-grouped-product-list-item__' . esc_attr( $column_id ) . '">' . apply_filters( 'woocommerce_grouped_product_list_column_' . $column_id, $value, $grouped_product_child ) . '</td>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
do_action( 'woocommerce_grouped_product_list_after_' . $column_id, $grouped_product_child );
}
echo '</tr>';
}
$post = $previous_post; // WPCS: override ok.
$post = $previous_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
setup_postdata( $post );
do_action( 'woocommerce_grouped_product_list_after', $grouped_product_columns, $quantites_required, $product );