Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
_get_block_templates_paths() WordPress Function
The get_block_templates_paths() function is used to get the path to the folder containing the block templates.
_get_block_templates_paths( string $base_directory ) #
Finds all nested template part file paths in a theme’s directory.
Parameters
- $base_directory
(string)(Required)The theme's file path.
Return
(array) A list of paths to all template part files.
Source
File: wp-includes/block-template-utils.php
function _get_block_templates_paths( $base_directory ) {
$path_list = array();
if ( file_exists( $base_directory ) ) {
$nested_files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $base_directory ) );
$nested_html_files = new RegexIterator( $nested_files, '/^.+\.html$/i', RecursiveRegexIterator::GET_MATCH );
foreach ( $nested_html_files as $path => $file ) {
$path_list[] = $path;
}
}
return $path_list;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |