Skip to content

Template parts: use WP_Theme_JSON_Resolver_Gutenberg instead of WP_Theme_JSON_Resolver#49198

Merged
aristath merged 1 commit intotrunkfrom
fix/use-gutenberg-instead-of-core-class-templates
Mar 20, 2023
Merged

Template parts: use WP_Theme_JSON_Resolver_Gutenberg instead of WP_Theme_JSON_Resolver#49198
aristath merged 1 commit intotrunkfrom
fix/use-gutenberg-instead-of-core-class-templates

Conversation

@oandregal
Copy link
Copy Markdown
Member

What?

Updates the templates screen to use the bundled Gutenberg class instead of the core one.

Why?

The bundled Gutenberg class may receive updates in the plugin, so we need to use it instead of core's.

Testing Instructions

Introduced at #42729

@oandregal oandregal requested a review from spacedmonkey as a code owner March 20, 2023 10:53
@oandregal oandregal self-assigned this Mar 20, 2023
@oandregal oandregal added the [Type] Bug An existing feature does not function as intended label Mar 20, 2023
@spacedmonkey
Copy link
Copy Markdown
Member

Instead of making changes like this, can we work on changing core to make it filterable.

Something like this.

function get_wp_theme_json_resolver(){
    $class_name = apply_filters( 'wp_theme_json_resolver_class', 'WP_Theme_JSON_Resolver' ):
    return $class_name;
}

@github-actions
Copy link
Copy Markdown

Flaky tests detected in e5f83e5.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4467373574
📝 Reported issues:

Copy link
Copy Markdown
Member

@aristath aristath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that ideally, we'd be able to change this globally, but until that happens I think this PR looks good and is safe to merge, allowing us to wok in Gutenberg until Core gets patched for this 👍

Copy link
Copy Markdown
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @oandregal!

@aristath aristath merged commit da530b2 into trunk Mar 20, 2023
@aristath aristath deleted the fix/use-gutenberg-instead-of-core-class-templates branch March 20, 2023 12:30
@github-actions github-actions bot added this to the Gutenberg 15.5 milestone Mar 20, 2023
@ryanwelcher ryanwelcher added the [Package] Edit Site /packages/edit-site label Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Edit Site /packages/edit-site [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants