WP_Block_Patterns_Registry::get_registered( string $pattern_name ): array

In this article

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

Parameters

$pattern_namestringrequired
Block pattern name including namespace.

Return

array Registered pattern properties.

Source

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

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

	return $pattern;
}

Changelog

VersionDescription
5.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.