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

Add origin and author to template rest api #36896

Merged
merged 8 commits into from Nov 29, 2021

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Nov 26, 2021

Description

This replicates the changes to the core REST API proposed by WordPress/wordpress-develop#1937 for Gutenberg.

related UI changes - #36763

@spacedmonkey
Copy link
Member

Can we update the schema tests to ensure these new properties are found in the REST API.

@talldan talldan force-pushed the add/origin-and-author-to-template-rest-api branch 2 times, most recently from ee7788e to 772f8c8 Compare November 29, 2021 03:18
@talldan
Copy link
Contributor Author

talldan commented Nov 29, 2021

Can we update the schema tests to ensure these new properties are found in the REST API.

I had a look into this, but it doesn't seem possible right now because the Gutenberg version of the REST API uses some code from WordPress core, which doesn't contain the necessary changes just yet.

Some examples:

I don't think the way it's working in the plugin is quite right, I already noticed that the Gutenberg version of the REST API is still active when running 5.9 as an example - #36898.

I'll follow up to fix these things.

@talldan talldan force-pushed the add/origin-and-author-to-template-rest-api branch from 772f8c8 to 33f0890 Compare November 29, 2021 04:21
@talldan
Copy link
Contributor Author

talldan commented Nov 29, 2021

I had a look into this, but it doesn't seem possible right now because the Gutenberg version of the REST API uses some code from WordPress core, which doesn't contain the necessary changes just yet.

Looks like I did need to update the tests. I don't think it's possible to test author support fully though until _build_block_template_result_from_post supports it in core.

@noisysocks noisysocks merged commit 81e6365 into trunk Nov 29, 2021
@noisysocks noisysocks deleted the add/origin-and-author-to-template-rest-api branch November 29, 2021 05:10
@github-actions github-actions bot added this to the Gutenberg 12.1 milestone Nov 29, 2021
noisysocks pushed a commit that referenced this pull request Nov 29, 2021
* Replicate API changes for template author support from WP core

* WIP - origin

* Use core version of template and template part post types and REST endpoints

* Change post_author to author

* Add translation domains

* Replicate more core changes in gutenberg

* Use gutenberg version of REST API

* Update tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core REST API Task Task for Core REST API efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants