wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
_get_block_templates_paths is private and should not be used in themes or plugins directly.
_get_block_templates_paths › WordPress Function
Desde5.9.0
Obsoleton/a
› _get_block_templates_paths ( $base_directory )
Acesso: |
|
Parâmetros: |
|
Retorna: |
|
Definido em: |
|
Codex: |
Finds all nested template part file paths in a theme's directory.
Funções relacionadas: _get_block_templates_files, get_block_templates, get_block_template, _get_block_template_file, block_template_part
Fonte
function _get_block_templates_paths( $base_directory ) { static $template_path_list = array(); if ( isset( $template_path_list[ $base_directory ] ) ) { return $template_path_list[ $base_directory ]; } $path_list = array(); if ( is_dir( $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; } } $template_path_list[ $base_directory ] = $path_list; return $path_list; }