#54679 closed defect (bug) (fixed)
Add missing default template areas to the Page/Post Editor settings
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.9 | Priority: | normal |
| Severity: | normal | Version: | 5.9 |
| Component: | Editor | Keywords: | has-patch |
| Focuses: | Cc: |
Description (last modified by )
The default template area settings shown when editing a template in the "Post/Page" editor got lost during backporting for 5.9.
In the Gutenberg plugin, we're filtering block_editor_settings_all to add this setting for block themes - https://github.com/WordPress/gutenberg/blob/trunk/lib/editor-settings.php#L20-L32.
Testing
Running following snippet in DevTools console currently returns an empty array:
wp.data.select('core/editor').__experimentalGetDefaultTemplatePartAreas();
After the fix, it should return the following values:
[
{
"area": "uncategorized",
"label": "General",
"description": "General templates often perform a specific role like displaying post content, and are not tied to any particular area.",
"icon": {},
"area_tag": "div"
},
{
"area": "header",
"label": "Header",
"description": "The Header template defines a page area that typically contains a title, logo, and main navigation.",
"icon": {},
"area_tag": "header"
},
{
"area": "footer",
"label": "Footer",
"description": "The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.",
"icon": {},
"area_tag": "footer"
}
]
Change History (6)
This ticket was mentioned in PR #2076 on WordPress/wordpress-develop by Mamaduka.
4 years ago
#1
- Keywords has-patch added
#2
@
4 years ago
- Description modified (diff)
- Summary changed from Add missing default template areas to the editor settings to Add missing default template areas to the Page/Post Editor settings
#3
@
4 years ago
Test Report
Env
- WordPress 5.9 Beta 4
- Chrome 96.0.4664.110
- Windows 10 (Local)
- Theme: Twenty Twenty-Two
- Plugin: None activated
Steps to test
- Enable a block theme, such as Twenty Twenty-Two.
- Navigate to
Pages > Add New. - To the right, expand the
Templatesection. - Click
Edit. - Insert a
Template Part. - Click
Choose existing. In theAREA:headings, you should seeUNDEFINED. - Apply PR 2076.
- Repeat steps 2-6. The
AREA:headings should now show the correct name.
Results
#5
@
4 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 52409:
SergeyBiryukov commented on PR #2076:
4 years ago
#6
Thanks for the PR! Merged in https://core.trac.wordpress.org/changeset/52409.
Testing instructions can be found in the Trac ticket.
I've not added this setting to the
get_default_block_editor_settingssince Template Parts are only supported in the Template Editing Mode.Gutenberg issue: https://github.com/WordPress/gutenberg/issues/37443
Trac ticket: https://core.trac.wordpress.org/ticket/54679
/cc @gziolo, @hellofromtonya