Retrieves all registered block patterns.
Parameters
$outside_init_only
booloptional- Return only patterns registered outside the
init
action.Default:
false
Source
public function get_all_registered( $outside_init_only = false ) {
$patterns = $outside_init_only
? $this->registered_patterns_outside_init
: $this->registered_patterns;
$hooked_blocks = get_hooked_blocks();
foreach ( $patterns as $index => $pattern ) {
$pattern['content'] = $this->get_content( $pattern['name'], $outside_init_only );
$patterns[ $index ]['content'] = $this->prepare_content( $pattern, $hooked_blocks );
}
return array_values( $patterns );
}
Changelog
Version | Description |
---|---|
5.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.