System Status compatibility with the classic-shortcode block (#40948)
This commit is contained in:
commit
822e4cf227
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Fix detection of cart and checkout classic-shortcode blocks in the system status report.
|
|
@ -1388,6 +1388,11 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
|
||||||
if ( $values['block'] && get_post( $page_id ) ) {
|
if ( $values['block'] && get_post( $page_id ) ) {
|
||||||
$block_required = true;
|
$block_required = true;
|
||||||
$block_present = WC_Blocks_Utils::has_block_in_page( $page_id, $values['block'] );
|
$block_present = WC_Blocks_Utils::has_block_in_page( $page_id, $values['block'] );
|
||||||
|
|
||||||
|
// Compatibility with the classic shortcode block which can be used instead of shortcodes.
|
||||||
|
if ( ! $block_present && ( 'woocommerce/checkout' === $values['block'] || 'woocommerce/cart' === $values['block'] ) ) {
|
||||||
|
$block_present = WC_Blocks_Utils::has_block_in_page( $page_id, 'woocommerce/classic-shortcode', true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrap up our findings into an output array.
|
// Wrap up our findings into an output array.
|
||||||
|
|
Loading…
Reference in New Issue