Make WordPress Core

Opened 7 weeks ago

Last modified 6 weeks ago

#60959 new feature request

A way to rename a pattern (similar to post title)

Reported by: oldrup's profile oldrup Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.5
Component: General Keywords:
Focuses: Cc:

Description

In Appearance > Patterns, it is possible Edit, Bin and Export a pattern.
When editing a pattern, I can change Visibility and Category.

But there does not appear to be any way I can rename a Pattern?

The only way appears to copy a pattern's content to a new pattern with the correct name, and delete the old pattern.

That is a bit cumbersome.

So an option, to rename a pattern, would be appreciated.

Change History (6)

#1 follow-up: @poena
6 weeks ago

Hi

The plan is for patterns in classic themes to use the same screen that block themes do in WordPress 6.6. That screen has the renaming capability.
See #59511

I don't think a specific Gutenberg issue been created for it though, @youknowriad?
If there is one we could close this ticket as 'reported upstream'.

#2 @youknowriad
6 weeks ago

I think we have an issue for "moving to the same screen". Right @wildworks ?

Also, as I understood it, it was not possible to move to the new screens because Gutenberg has to support two WP versions but this doesn't really make sense to me to be honest, Gutenberg can add the right overrides tot make the new screens work. What would break in Gutenberg + 6.4 if we use the new screens for classic themes in Gutenberg today? (Maybe it's a discussion for another thread, please redirect)

#3 @wildworks
6 weeks ago

The plan is for patterns in classic themes to use the same screen that block themes do in WordPress 6.6.

In WordPress 6.6, I don't think we can publish a new Patterns page for classic themes. This is because the Gutenberg plugin should have supported WordPress 6.4 when 6.6 was released, and WordPress 6.4 does not allow access to the new Patterns page. At the earliest, the new Patterns page should be released in WordPress 6.7. Please refer to this roadmap.

What would break in Gutenberg + 6.4 if we use the new screens for classic themes in Gutenberg today?

There are links to the Patterns page in several places. For example, "Options" menu > "Manage patterns" in the Post Editor. Alternatively, you can access it via the Command Palette. Suppose the Gutenberg plugin changes this link to the new Pattern page (/wp-admin/site-editor.php?path=%2Fpatterns) instead of the dashboard (/wp-admin/edit.php?post_type=wp_block). However, as of WP6.4, the classic theme cannot access the new Patterns page. As of WP6.4, classic themes can only access the template parts page in the Site Editor (/wp-admin/site-editor.php?path=%2Fwp_template_part%2Fall) if they support template parts (See this code).

#4 @youknowriad
6 weeks ago

@wildworks we might be able to hook into wp_die_handler and "do nothing" with the right conditions :P

Last edited 6 weeks ago by youknowriad (previous) (diff)

#5 @wildworks
6 weeks ago

Amazing, I didn't know we could hook wp_die() itself!

If we can properly incorporate that hook into the Gutenberg plugin, we can publish the new Patterns page for the Classic theme in WP6.4 + Gutenberg or in the next major release (WP6.6), right? If so, I'd like to try that approach.

Additionally, that approach may also address the concerns raised in this comment (Patterns: remove "Manage all parts" page & link #60689).

#6 in reply to: ↑ 1 @oldrup
6 weeks ago

Replying to poena:

The plan is for patterns in classic themes to use the same screen that block themes do in WordPress 6.6. That screen has the renaming capability.

Ah, wasn't aware that this is a shortcoming when using classic themes. Nice catch @poena, I'm using a classic theme, that's true.

The pattern feature of WordPress, even when using classic themes, has matured substantially, so I'm using it a lot with clients now. The missing option to rename is a rough edge, but as said, nothing critical.

I look forward to testing any proposed solution.

Note: See TracTickets for help on using tickets.