Key Changes
- Template Management: Allows multiple templates with the same target slug and introduces the ability to switch between them by setting one as “active.”
- Theme Template Control: Users can now disable theme templates (except the essential index template)
- New UI UI is an acronym for User Interface – the layout of the page the user interacts with. Think ‘how are they doing that’ and less about what they are doing.: Adds “Active templates” and “Custom Templates” views in the Site Editor
- API An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. Simplification: User templates now use standard Post Type REST API The REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think “phone app” or “website”) can communicate with the data store (think “database” or “file system”) https://developer.wordpress.org/rest-api/. endpoints
- Enhanced Features: Enables revisions, duplication, and trashing through normal Post actions
Benefits
- Custom templates are retained when switching themes
- Users can disable template edits when needed
- New templates can be created without immediately publishing
- Templates can be added for all slugs, not just missing ones
- Improvements to template revisions, template duplication, and deleting templates
- And more. For full details, see the PR description
Testing Instructions
- Install and activate the Gutenberg Nightly plugin from Gutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ Times, or use this Playground link
- Navigate to Site Editor > Templates and test the new template management features
- Verify that you can see template categories for Active, Custom, and theme templates.
- Test custom theme templates
- Create, edit, and save a custom theme template, and confirm it only appears in the Custom templates list.
- Test active templates
- Create multiple templates for the same target slug (ie, single-post) and ensure you can activate/deactivate different templates, and that the front-end rendering uses the correct template.
- Confirm that when activating one template, the other templates for that slug are marked as inactive.
- Test that you can activate a template in the template editing view.
- Test default template fallback
- Deactivate a theme template and ensure the correct fallback template (in line with the template hierarchy) is used instead.
- Test switching themes
- Once you’ve created a custom template, switch to a different block Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. theme and ensure the custom template remains.
- Test that template revisions, duplicating templates, and deleting templates work as expected.
Testing Steps
Breaking Changes
- Changes to
getEditedPostIdandgetCurrentPostIdmay impact plugins - Plugins should migrate to use
getEditedPostSluginstead
Logging bugs and discussions
All existing bugs are being tracked in the following tracking issue in the Gutenberg GitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ repository: https://github.com/WordPress/gutenberg/issues/71735
If you encounter any new bugs related to this feature during testing, please log them as new issues and mention them in the above tracking issue.
If you’re unsure whether what you are experiencing is a bug, you can ask in the #outreach channel on the WordPress Slack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/..
+make.wordpress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org//core Core is the set of software required to run WordPress. The Core Development Team builds WordPress., +make.wordpress.org/themes
Props to @krupajnanda, @annezazu, @bph, and @juanmaguitar for assistance in reviewing this post.


Leave a Reply