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

Try/rest global styles controller inherits post controller #6022

Open
wants to merge 8 commits into
base: trunk
Choose a base branch
from

Conversation

spacedmonkey
Copy link
Member

@spacedmonkey spacedmonkey commented Feb 2, 2024

Trac ticket: https://core.trac.wordpress.org/ticket/60131


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

ramonjd and others added 3 commits February 2, 2024 12:12
Extending `WP_REST_Global_Styles_Controller` with `WP_REST_Posts_Controller`
Copy link

github-actions bot commented Feb 2, 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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @jonnynews.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

Core SVN

If you're a Core Committer, use this list when committing to wordpress-develop in SVN:

Props: ramonopoly, spacedmonkey, mukesh27.

GitHub Merge commits

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

Unlinked contributors: jonnynews.

Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: spacedmonkey <spacedmonkey@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@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

github-actions bot commented Feb 2, 2024

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copy link
Member

@ramonjd ramonjd 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 getting this alternative up. Looks like a simple approach.

I've closed #6008

Also checked manually in the site editor. Global styles endpoint is being called and loaded correctly.

// in the console
await wp.data.select( 'core' ).getEntityRecord( 'root', 'globalStyles', await wp.data.select( 'core' ).__experimentalGetCurrentGlobalStylesId() 

If we get this in, I'll rebase:

Hopefully that'll be baked and ready to go too.

Thanks a lot!

src/wp-includes/class-wp-post-type.php Show resolved Hide resolved
@ramonjd
Copy link
Member

ramonjd commented Feb 5, 2024

Could we hang this one onto https://core.trac.wordpress.org/ticket/60131 as well? I can update the trac description if so. Cheers.

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

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

We still need the changes in:

did you mean to close that PR and incorporate its changes them into this PR?

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

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

LGTM (again) 😄

To clarify my last review comment, #5699 extends the Global styles revisions controller with WP_REST_Revisions_Controller - changes that are not covered by this PR.

I assumed the closing comment in #5699 meant that this PR was going to carry over its commits.

All good. Either we reopen #5699 or I can create a new PR with the same changes after this PR lands.

Cheers!

ramonjd added a commit to ramonjd/wordpress-develop that referenced this pull request Feb 7, 2024
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: spacedmonkey <spacedmonkey@git.wordpress.org>
ramonjd added a commit to ramonjd/wordpress-develop that referenced this pull request Feb 7, 2024
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: spacedmonkey <spacedmonkey@git.wordpress.org>
ramonjd added a commit to ramonjd/wordpress-develop that referenced this pull request Feb 7, 2024
Updating generated API file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants