wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
_add_block_template_info is private and should not be used in themes or plugins directly.
_add_block_template_info › WordPress Function
Depuis5.9.0
Dépréciéen/a
› _add_block_template_info ( $template_item )
| Accès: |
|
| Paramètres: |
|
| Retourne: |
|
| Défini(e) dans: |
|
| Codex: |
Attempts to add custom template information to the template item.
Fonctions en relation: _add_block_template_part_area_info, _get_block_template_file, _get_block_templates_files, get_block_template, locate_block_template
Source
function _add_block_template_info( $template_item ) {
if ( ! wp_theme_has_theme_json() ) {
return $template_item;
}
$theme_data = wp_get_theme_data_custom_templates();
if ( isset( $theme_data[ $template_item['slug'] ] ) ) {
$template_item['title'] = $theme_data[ $template_item['slug'] ]['title'];
$template_item['postTypes'] = $theme_data[ $template_item['slug'] ]['postTypes'];
}
return $template_item;
}