WP_Block_List::__construct()publicWP 5.5.0

Constructor.

Populates object properties from the provided block instance argument.

Метод класса: WP_Block_List{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WP_Block_List = new WP_Block_List();
$WP_Block_List->__construct( $blocks, $available_context, $registry );
$blocks(array[]|WP_Block[]) (обязательный)
Array of parsed block data, or block instances.
$available_context(массив)
Optional array of ancestry context values.
По умолчанию: array()
$registry(WP_Block_Type_Registry)
Optional block type registry.
По умолчанию: null

Список изменений

С версии 5.5.0 Введена.

Код WP_Block_List::__construct() WP 6.5.2

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