Skip to content

Sidebar missing from get_allowed_block_template_part_areas() despite defined constant #75962

@mrleemon

Description

@mrleemon

Description

In wp-includes/block-template-utils.php, there are four core constants defined for template part areas:

WP_TEMPLATE_PART_AREA_HEADER
WP_TEMPLATE_PART_AREA_FOOTER
WP_TEMPLATE_PART_AREA_SIDEBAR
WP_TEMPLATE_PART_AREA_UNCATEGORIZED

However, in the function get_allowed_block_template_part_areas(), only the Header, Footer, and Uncategorized areas are included in the $default_area_definitions array. The Sidebar area is defined as a constant but is not returned by the function that determines which areas are "allowed" or registered by default in the UI.

I would like to clarify if the omission of WP_TEMPLATE_PART_AREA_SIDEBAR from get_allowed_block_template_part_areas() is an intentional design choice or an oversight.

If it is an oversight, the Sidebar area should be added to the default array so that theme developers can use the sidebar area without needing to manually filter default_wp_template_part_areas.

Step-by-step reproduction instructions

  1. Check the https://github.com/WordPress/wordpress-develop/blob/0c3e42c238fc2ca907bbe649160598f39267d812/src/wp-includes/block-template-utils.php#L70-L121 file

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.9.1
  • No Gutenberg plugin

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Technical FeedbackNeeds testing from a developer perspective.[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions