Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Themes REST API endpoint: Add stylesheet_uri and template_uri fields to the response (WP 6.6) #62211

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Jun 3, 2024

What?

This PR syncs updates to WP_REST_Themes_Controller Core for 6.6 compatibility.

The update adds the stylesheet_uri and template_uri fields to the API response.

Related ticket: https://core.trac.wordpress.org/ticket/61021

Why?

To ensure that any plugin features that rely on these properties will have access to them for WordPress versions < 6.6.

How?

Through register_rest_field

Testing Instructions

I tested running WordPress 6.5 and this branch of Gutenberg.

Then head over to the Site Editor and enter the following in the console:

await wp.data.resolveSelect( 'core' ).getCurrentTheme()

or also

wp.apiFetch( { path: '/wp/v2/themes/twentytwentyfour' } );

@ramonjd ramonjd changed the title Themes REST API endpoint: Add stylesheet_uri and template_uri fields to the response (WP 6.6) Jun 3, 2024
@ramonjd ramonjd added the Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core label Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/compat/wordpress-6.6/rest-api.php

Copy link

github-actions bot commented Jun 3, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

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

Thanks for following up! This is testing well for me with GB applied in a WP 6.5.3 testing environment:

image

LGTM 🚀

@ramonjd ramonjd merged commit ace8835 into trunk Jun 4, 2024
72 of 73 checks passed
@ramonjd ramonjd deleted the backport/core-theme-rest-properties-6-6 branch June 4, 2024 00:25
@github-actions github-actions bot added this to the Gutenberg 18.6 milestone Jun 4, 2024
carstingaxion pushed a commit to carstingaxion/gutenberg that referenced this pull request Jun 4, 2024
…for 6.6 compat (WordPress#62211)

Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
patil-vipul pushed a commit to patil-vipul/gutenberg that referenced this pull request Jun 17, 2024
…for 6.6 compat (WordPress#62211)

Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core REST API Interaction Related to REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants