Test Failures: Check WP version 5.9 before adding mini_cart_block to WC Tracker (#32862)

This commit is contained in:
Paul Sealock 2022-05-04 14:09:21 +12:00 committed by GitHub
parent afe6e84ab0
commit 6553de469b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Check WP version 5.9 before adding mini_cart_block to WC Tracker

View File

@ -167,8 +167,10 @@ class WC_Tracker {
// Cart & checkout tech (blocks or shortcodes).
$data['cart_checkout'] = self::get_cart_checkout_info();
// Mini Cart block.
$data['mini_cart_block'] = self::get_mini_cart_info();
// Mini Cart block, which only exists since wp 5.9.
if ( version_compare( get_bloginfo( 'version' ), '5.9', '>=' ) ) {
$data['mini_cart_block'] = self::get_mini_cart_info();
}
// WooCommerce Admin info.
$data['wc_admin_disabled'] = apply_filters( 'woocommerce_admin_disabled', false ) ? 'yes' : 'no';