Prepares the content of a block pattern. If hooked blocks are registered, they get injected into the pattern, when they met the defined criteria.
Parameters
$patternarrayrequired- Registered pattern properties.
$hooked_blocksarrayrequired- The list of hooked blocks.
Source
if ( $outside_init_only ) {
$patterns = &$this->registered_patterns_outside_init;
} else {
$patterns = &$this->registered_patterns;
}
$file_path = $patterns[ $pattern_name ]['filePath'] ?? '';
$is_stringy = is_string( $file_path ) || ( is_object( $file_path ) && method_exists( $file_path, '__toString' ) );
$pattern_path = $is_stringy ? realpath( (string) $file_path ) : null;
if (
! isset( $patterns[ $pattern_name ]['content'] ) &&
is_string( $pattern_path ) &&
( str_ends_with( $pattern_path, '.php' ) || str_ends_with( $pattern_path, '.html' ) ) &&
is_file( $pattern_path ) &&
Changelog
| Version | Description |
|---|---|
| 6.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.