Update includes/blocks/class-wc-blocks-utils.php

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
This commit is contained in:
Bartosz Budzanowski 2021-01-06 15:25:15 +01:00 committed by GitHub
parent 0b4eb9aa36
commit ca3cd5fd7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -62,11 +62,11 @@ class WC_Blocks_Utils {
/**
* Check if a given page contains a particular block.
*
* @param string $page (int|WP_Post) Page post ID or post object.
* @param int|WP_Post $page Page post ID or post object.
* @param string $block_name The name (id) of a block, e.g. `woocommerce/cart`.
* @return bool|null Boolean value if the page contains the block or not. Null in case the page does not exist.
*/
public static function does_page_contains_block( $page, $block_name ) {
public static function has_block_in_page( $page, $block_name ) {
$page_to_check = get_post( $page );
if ( null === $page_to_check ) {
return null;