Skip to content

API to define a default template for the template mode #32752

@youknowriad

Description

@youknowriad

WordPress 5.8 will introduce a template mode in the post editor https://make.wordpress.org/core/2021/06/14/introducing-the-template-editor-in-wordpress-5-8/

That mode allows users to create block templates and assign them to posts and pages. A default starting template is used to repopulate newly created templates.

Ideally, themes should be able to define the content of the initial template. Let's try to provide an API to do so. This API should be able to scale to FSE themes as well.

The simplest solution might be to add a settings to the block_editor_settings_all filter as this can be provided in php and made translatable easily.

An alternative would be a file in the theme (convention) but since we don't want to add block-templates to themes yet, it seems premature for this option.

cc @TimothyBJacobs @aristath

Metadata

Metadata

Assignees

Labels

[Feature] Template Editing ModeRelated to the template editor available in the Block Editor[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Status] In ProgressTracking issues with work in progress[Type] New APINew API to be used by plugin developers or package users.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions