In system status report, detect and allow usage of the classic-shortcode block

This commit is contained in:
Mike Jolley 2023-10-23 16:24:19 +01:00
parent 2fb59293ad
commit 31feb9aa94
1 changed files with 5 additions and 0 deletions

View File

@ -1388,6 +1388,11 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
if ( $values['block'] && get_post( $page_id ) ) {
$block_required = true;
$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 && ( $values['block'] === 'woocommerce/checkout' || $values['block'] === 'woocommerce/cart' ) ) {
$block_present = WC_Blocks_Utils::has_block_in_page( $page_id, 'woocommerce/classic-shortcode', true );
}
}
// Wrap up our findings into an output array.