Skip to content

Generated pattern headers use the template slug as title and category names instead of slugs #871

Open

Description

@iamtakashi

What happens

The pattern headers CBT writes use the wrong values for the title and categories.

Title. Patterns created from templates use the template slug as the title:

https://github.com/WordPress/create-block-theme/blob/5524f195e8/includes/create-theme/theme-patterns.php#L59-L78

 * Title: {$template_slug}

So a theme gets patterns titled "archive-product", "order-confirmation", "home-header" and so on. The title becomes the block name in List View and is sent to translators.

Categories. Patterns saved from the editor get the category display names instead of slugs:

https://github.com/WordPress/create-block-theme/blob/5524f195e8/includes/create-theme/theme-patterns.php#L86-L87

wp_list_pluck( $pattern_category_list, 'name' )

So headers read Categories: Text, Categories: About or Categories: Banners. Core matches category slugs, so these patterns don't appear under the core Text, About or Banners categories (the core slug for the last one is banner).

Expected

  • Template-based patterns use the template's title ($template->title), e.g. "Product Catalog".
  • Categories use the term slugs.

Related

#562 (saving turns templates into patterns).

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

Activity

  1. ishitaj34 commented on Sep 29, 2026

    @ishitaj34

    Picking this issue up.

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