[wp-trac] [WordPress Trac] #54679: Add missing default template areas to the Page/Post Editor settings (was: Add missing default template areas to the editor settings)

WordPress Trac noreply at wordpress.org
Wed Dec 22 08:52:28 UTC 2021


#54679: Add missing default template areas to the Page/Post Editor settings
--------------------------+------------------------------
 Reporter:  Mamaduka      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Description changed by costdev:

Old description:

> The default template area settings 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"
>     }
> ]
> }}}

New description:

 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"
     }
 ]
 }}}

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54679#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list