WP_Block_Patterns_Registry::get_registered()publicWP 5.5.0

Retrieves an array containing the properties of a registered block pattern.

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

Хуков нет.

Возвращает

Массив. Registered pattern properties.

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

$WP_Block_Patterns_Registry = new WP_Block_Patterns_Registry();
$WP_Block_Patterns_Registry->get_registered( $pattern_name );
$pattern_name(строка) (обязательный)
Block pattern name including namespace.

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

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

Код WP_Block_Patterns_Registry::get_registered() WP 6.5.3

public function get_registered( $pattern_name ) {
	if ( ! $this->is_registered( $pattern_name ) ) {
		return null;
	}

	$pattern            = $this->registered_patterns[ $pattern_name ];
	$pattern['content'] = $this->get_content( $pattern_name );
	$pattern['content'] = $this->prepare_content( $pattern, get_hooked_blocks() );

	return $pattern;
}