WP_Block_List::__construct

Advertisement

Summery Summery

Constructor.

Syntax Syntax

WP_Block_List::__construct( array[]|WP_Block[] $blocks, array $available_context = array(), WP_Block_Type_Registry $registry = null )

Description Description

Populates object properties from the provided block instance argument.

Parameters Parameters

$blocks

(Required) Array of parsed block data, or block instances.

$available_context

(Optional) array of ancestry context values.

Default value: array()

$registry

(Optional) block type registry.

Default value: null

Source Source

File: wp-includes/class-wp-block-list.php

	public function __construct( $blocks, $available_context = array(), $registry = null ) {
		if ( ! $registry instanceof WP_Block_Type_Registry ) {
			$registry = WP_Block_Type_Registry::get_instance();
		}

		$this->blocks            = $blocks;
		$this->available_context = $available_context;
		$this->registry          = $registry;
	}

Advertisement

Changelog Changelog

Changelog
Version Description
5.5.0 Introduced.

Advertisement

Leave a Reply