WC_Blocks_Utils::has_block_in_page( int|WP_Post $page, string $block_name )
Check if a given page contains a particular block.
Description Description
Parameters Parameters
- $page
-
(Required) Page post ID or post object.
- $block_name
-
(Required) The name (id) of a block, e.g.
woocommerce/cart
.
Return Return
(bool) Boolean value if the page contains the block or not. Null in case the page does not exist.
Source Source
File: includes/blocks/class-wc-blocks-utils.php