Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_Tracker::get_all_blocks_from_page( string $woo_page_name )
Get blocks from a woocommerce page.
Description Description
Parameters Parameters
- $woo_page_name
-
(Required) A woocommerce page e.g.
checkout
orcart
.
Return Return
(array) Array of blocks as returned by parse_blocks().
Source Source
File: includes/class-wc-tracker.php
private static function get_all_blocks_from_page( $woo_page_name ) { $page_id = wc_get_page_id( $woo_page_name ); $page = get_post( $page_id ); if ( ! $page ) { return array(); } $blocks = parse_blocks( $page->post_content ); if ( ! $blocks ) { return array(); } return $blocks; }