A WordPress-centric search engine for devs and theme authors

wp-includes/block-template-utils.php › WordPress File

Utilities used to fetch and create templates and template parts.

Function Short description
block_footer_areaPrint the footer template-part.
block_header_areaPrint the header template-part.
block_template_partPrint a template-part.
get_allowed_block_template_part_areasReturns a filtered list of allowed area values for template parts.
get_block_file_templateRetrieves a single unified template object using its id.
get_block_templateRetrieves a single unified template object using its id.
get_block_templatesRetrieves a list of unified template objects based on a query.
get_block_theme_foldersFor backward compatibility reasons, block themes might be using block-templates or block-template-parts, this function ensures we fallback to these folders properly.
get_default_block_template_typesReturns a filtered list of default template types, containing their localized titles and descriptions.
wp_generate_block_templates_export_fileCreates an export of the current templates and template parts from the site editor at the specified path in a ZIP file.
wp_is_theme_directory_ignoredFilters theme directories that should be ignored during export.
_add_block_template_infoAttempts to add custom template information to the template item.
_add_block_template_part_area_infoAttempts to add the template part's area information to the input template.
_build_block_template_result_from_fileBuild a unified template object based on a theme file.
_build_block_template_result_from_postBuild a unified template object based a post Object.
_filter_block_template_part_areaChecks whether the input 'area' is a supported value.
_flatten_blocksReturns an array containing the references of the passed blocks and their inner blocks.
_get_block_templates_filesRetrieves the template files from the theme.
_get_block_templates_pathsFinds all nested template part file paths in a theme's directory.
_get_block_template_fileRetrieves the template file from the theme for a given slug.
_inject_theme_attribute_in_block_template_contentParses wp_template content and injects the active theme's stylesheet as a theme attribute into each wp_template_part
_remove_theme_attribute_in_block_template_contentParses a block template and removes the theme attribute from each template part.