Make WordPress Core

Opened 5 months ago

Last modified 4 days ago

#58827 new enhancement

Publish the Patterns page in the Site Editor to all non-block themes

Reported by: wildworks's profile wildworks Owned by:
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch has-testing-info needs-testing
Focuses: Cc:

Description

I based my suggestion on the discussion about the compatibility of the Site Editor and non-block themes in the Gutenberg project: https://github.com/WordPress/gutenberg/issues/52150#issuecomment-1634480850

In the latest Gutenberg (and in WordPress 6.3), the features and pages available in the Site Editor vary from theme to theme as follows:

  • Block Theme: Access to all functions and pages.
  • Classic Theme with block-template-parts support: Template Parts menu appears below the Appearance menu. You can edit the template parts of the theme, but cannot add new ones. You can access the upper Patterns menu to access the new Pattern management features.
  • Classic Theme without block-template-parts support: All functions and pages are not accessible.

In order to make this new Patterns page available to all classic themes, with or without block-template-parts support, I would like to add a Patterns menu under the Appearance menu.

Change History (14)

#1 @wildworks
3 months ago

In the following PR, we were looking for a way to allow all classic themes to access the Pattern page of the Site Editor in the future, while maintaining backward compatibility and preventing possible problems caused by the combination of different WordPres versions and whether or not the Gutenberg plugin is activated.

https://github.com/WordPress/gutenberg/pull/54066

After much discussion, we are considering taking the following approach.

In Core WP 6.4:

  1. Add an Appearance -> Patterns link for all classic themes that point to edit.php?post_type=wp_block.
  2. Allow site-editor.php?path=/patterns access for classic themes internally.

In Gutenberg after the minimum required version is WP 6.4:

  1. Change all "Manage patterns" links to point to site-editor.php?path=/patterns.
  2. Change the Appearance -> Patterns links for classic themes to point to site-editor.php?path=/patterns.

I would like to submit a core patch to accomplish these things.

props: @aaronrobertshaw, @glendaviesnz, @kevin940726, @jameskoster

Last edited 3 months ago by wildworks (previous) (diff)

This ticket was mentioned in PR #5201 on WordPress/wordpress-develop by @wildworks.


3 months ago
#2

  • Keywords has-patch added

Trac ticket:

@wildworks commented on PR #5201:


3 months ago
#3

Please let me know if there are any other considerations or potential issues in order to ship this patch and Gutenberg PR with WordPress 6.4. Should we also ask someone on the core team for feedback?

@aaronrobertshaw commented on PR #5201:


3 months ago
#4

Should we also ask someone on the core team for feedback?

That would be a wise move I think. I'm caught up on other patterns issues/PRs at the moment but will try and organise another review for this one.

Thanks for the nudge 👍

@aaronrobertshaw commented on PR #5201:


3 months ago
#5

Please let me know if there are any other considerations or potential issues in order to ship this patch and https://github.com/WordPress/gutenberg/pull/54066 with WordPress 6.4. Should we also ask someone on the core team for feedback?

I believe this patch is fine and good to go.

The Gutenberg PR though still has an unaddressed issue that I'd flagged previously. The command palette change in that PR needs reverting so that the user is taken to the same location as the links introduced in this patch for classic themes.

@wildworks commented on PR #5201:


3 months ago
#6

Update: The Gutenberg PR that corresponds to this core patch is actually #54422. Sorry for causing confusion.

Once this core patch is applied, the classic theme can access the Site Editor's Patterns page by typing site-editor.php?path=/patterns directly. #54422 fixes unintended behavior in such cases.

#7 @mikeschroder
2 months ago

  • Milestone changed from Awaiting Review to 6.4

Putting this into the 6.4 milestone per @mikachan's request.

Last edited 2 months ago by mikeschroder (previous) (diff)

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


2 months ago

#9 @hellofromTonya
2 months ago

  • Component changed from General to Editor
  • Keywords has-testing-info needs-testing added
  • Milestone changed from 6.4 to 6.5

Looking at the linked issue from Gutenberg, that issue is marked as [Type] Enhancement.

Asking in the Make/WordPress slack core channel today, @wildworks noted:

I think this patch (and the Gutenberg's PR) are enhancements and have believed so since the beginning of working on these features.

However, I may have confused this by not changing the Type label to enhancement when I submitted the ticket on Trac.

As this patch/ticket are enhancement, it's too late in the 6.4 cycle, as Beta 1 has already shipped. Per the handbook:

Phase 3: Beta. Betas are released, and beta testers are asked to start reporting bugs. No more commits for new enhancements or feature requests are allowed for the rest of the release.

Moving this to 6.5.

@aaronrobertshaw commented on PR #5201:


2 months ago
#10

Just noting here that this enhancement has been slated for WP 6.5 as it missed the 6.4 beta
(See https://core.trac.wordpress.org/ticket/58827)

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


2 months ago

#12 @rajinsharwar
4 weeks ago

Hi @wildworks, I tested your patch against the trunk as of today. LGTM on my tests, but there is one thing that I found.

So, suppose I am using a theme that doesn't have the "block-template-parts", for example, Astra. I activated that theme, and in the functions.php, I added: add_theme_support( 'block-template-parts' );

Then, the Template parts menu option was visible. I clicked on that, and it took many seconds to load, and after that the die message: "The theme you are currently using is not compatible with the Site Editor." was shown. After I returned back, I found that there was no more the "template Parts" option on the menu and the code of "add_theme_support( 'block-template-parts' );" was removed from my theme's functions.php.

I am not really sure if this behavior is good, as modifying the theme files without notice isn't something the core should do.

#13 @wildworks
4 weeks ago

Thank you for the test.

I also enabled the Astra theme and opted in to hoge, but I couldn't reproduce the problem.

  • The Template Parts menu is now under the Appearance menu.
  • Access the Template Parts menu.
  • I saw the All template parts page (this theme has no template parts, so I didn't see anything in the list)
  • I was able to return to the dashboard normally.

This patch only adds one menu (Patterns) and controls access depending on the theme type, but does not modify any theme files.

#14 @hellofromTonya
4 days ago

  • Type changed from defect (bug) to enhancement

As this is adding functionality for classic themes, moving it to an enhancement rather than a bug.

Note: See TracTickets for help on using tickets.