Skip to content

Localize Text skips Accordion headings #867

Open

Description

@iamtakashi

What happens

"Localize Text" leaves Accordion headings hardcoded. Exporting a template that uses the core Accordion block writes the heading text as plain text:

<span class="wp-block-accordion-heading__toggle-title">Description</span>

get_text_replacement_patterns_for_html() has no case for core/accordion-heading, so the block is skipped:

https://github.com/WordPress/create-block-theme/blob/5524f195e8/includes/create-theme/theme-locale.php#L217-L262

We found it in a WooCommerce theme's Single Product template, where the product details use an Accordion ("Description", "Additional information").

Expected

The heading text is wrapped in esc_html_e(), like Heading and Details summaries.

Suggested fix

Add core/accordion-heading with a pattern for <span class="wp-block-accordion-heading__toggle-title">…</span>.

Drafted with AI assistance, verified by me against a theme exported with Create Block Theme and the source.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions