WordPress at Your Fingertips
function is not described

WC_Blocks_Utils::get_all_blocks_from_page() private WC 1.0

Get blocks from a woocommerce page.

{} It's a method of the class: WC_Blocks_Utils{}

No Hooks.

Return

Array. Array of blocks as returned by parse_blocks().

Usage

$result = WC_Blocks_Utils::get_all_blocks_from_page( $woo_page_name );
$woo_page_name(string) (required)
A woocommerce page e.g. checkout or cart.

Code of WC_Blocks_Utils::get_all_blocks_from_page() WC 5.6.0

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;
}