GC_Block_List::__construct()

最后更新于:2021-11-26 10:06:57

GC_Block_List::__construct( array[]|GC_Block[]$blocks, array$available_context=array(), GC_Block_Type_Registry$registry=null)

Constructor.

参数

$blocks

(array[]|GC_Block[]) (Required) Array of parsed block data, or block instances.

$available_context

(array) (Optional) array of ancestry context values.

Default value: array()

$registry

(GC_Block_Type_Registry) (Optional) block type registry.

Default value: null

源文件

文件: gc-includes/class-gc-block-list.php

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

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