Skip to content

[WIP] Global styles controller: extend with WP_REST_Posts_Controller#6008

Closed
ramonjd wants to merge 2 commits intoWordPress:trunkfrom
ramonjd:try/rest-global-styles-controller-inherits-post-controller
Closed

[WIP] Global styles controller: extend with WP_REST_Posts_Controller#6008
ramonjd wants to merge 2 commits intoWordPress:trunkfrom
ramonjd:try/rest-global-styles-controller-inherits-post-controller

Conversation

@ramonjd
Copy link
Copy Markdown
Member

@ramonjd ramonjd commented Feb 2, 2024

WIP - Extending WP_REST_Global_Styles_Controller with WP_REST_Posts_Controller

See: #5699 (review)

Extending `WP_REST_Global_Styles_Controller` with `WP_REST_Posts_Controller`
@github-actions
Copy link
Copy Markdown

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.

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.

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.

@github-actions
Copy link
Copy Markdown

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.

@mukeshpanchal27
Copy link
Copy Markdown
Member

@ramonjd are you checking the unit test failure?

@ramonjd
Copy link
Copy Markdown
Member Author

ramonjd commented Feb 2, 2024

are you checking the unit test failure?

@mukeshpanchal27 This PR is work in progress (WIP) so, no, not yet. I still need to work on the feature a bit first.

Thanks!

'/wp/v2/comments/(?P<id>[\\d]+)',
'/wp/v2/global-styles/(?P<id>[\/\w-]+)',
'/wp/v2/global-styles/(?P<id>[\d]+)/autosaves',
'/wp/v2/global-styles/(?P<parent>[\d]+)/autosaves/(?P<id>[\d]+)',
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@jonnynews

It would be handy to be able to opt-out of these as well if folks want to skip registering these routes, e.g., 'autosave_rest_controller_class' => false, in register_post_type().

1f51e1f#diff-52c8c412194f4e6bf199f6bbf576b66410eb470aa181330bdd7c290c9ed075e4R929

Copy link
Copy Markdown
Member Author

@ramonjd ramonjd Feb 2, 2024

Choose a reason for hiding this comment

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

Or a supports_autosaves, similar to supports_revisions? 🤷🏻

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ramonjd For now, we could just add the global post type here -

if ( 'attachment' === $this->name ) {
return null;
}

@spacedmonkey spacedmonkey self-requested a review February 2, 2024 22:08
@spacedmonkey
Copy link
Copy Markdown
Member

@ramonjd I put together my own PR for this #6022. It is a couple of fixes applied to your PR. I think this version of the PR is very nearly there and is near commit.

@ramonjd
Copy link
Copy Markdown
Member Author

ramonjd commented Feb 2, 2024

@ramonjd I put together my own PR for this #6022. It is a couple of fixes applied to your PR. I think this version of the PR is very nearly there and is near commit.

That's awesome! Thanks 🍺

I'll give it test next week.

@ramonjd
Copy link
Copy Markdown
Member Author

ramonjd commented Feb 4, 2024

I put together my own PR for this #6022. It is a couple of fixes applied to your PR. I think this version of the PR is very nearly there and is near commit.

LGTM

I'll close this one in favour of #6022

@ramonjd ramonjd closed this Feb 4, 2024
@ramonjd ramonjd deleted the try/rest-global-styles-controller-inherits-post-controller branch February 4, 2024 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants