wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
get_block_theme_folders › WordPress Function
Depuis5.9.0
Dépréciéen/a
› get_block_theme_folders ( $theme_stylesheet = null )
| Paramètres: |
|
| Retourne: |
|
| Défini(e) dans: |
|
| Codex: |
For backward compatibility reasons, block themes might be using block-templates or block-template-parts, this function ensures we fallback to these folders properly.
Fonctions en relation: _get_block_templates_files, _get_block_template_file, get_block_templates, get_block_template, get_block_categories
Source
function get_block_theme_folders( $theme_stylesheet = null ) {
$theme = wp_get_theme( (string) $theme_stylesheet );
if ( ! $theme->exists() ) {
// Return the default folders if the theme doesn't exist.
return array(
'wp_template' => 'templates',
'wp_template_part' => 'parts',
);
}
return $theme->get_block_template_folders();
}