Apply Rector suggestions for PHP 8.1 (#43237)

* PHP8 Fixes for templates dir

* Add changelog entry

* Bump template version

* Bump template version number

* Update changelog entry

* Typo
This commit is contained in:
Alfredo Sumaran 2024-01-19 04:07:53 -05:00 committed by GitHub
parent 5b6897e690
commit f2e90aa01d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Type check $available_methods before using it

View File

@ -14,7 +14,7 @@
*
* @see https://woo.com/document/template-structure/
* @package WooCommerce\Templates
* @version 7.3.0
* @version 8.6.0
*/
defined( 'ABSPATH' ) || exit;
@ -27,7 +27,7 @@ $calculator_text = '';
<tr class="woocommerce-shipping-totals shipping">
<th><?php echo wp_kses_post( $package_name ); ?></th>
<td data-title="<?php echo esc_attr( $package_name ); ?>">
<?php if ( $available_methods ) : ?>
<?php if ( isset( $available_methods ) && is_array( $available_methods ) ) : ?>
<ul id="shipping_method" class="woocommerce-shipping-methods">
<?php foreach ( $available_methods as $method ) : ?>
<li>