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

Rest: Add wp-block-editor/v1/settings endpoint #1756

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

enejb
Copy link

@enejb enejb commented Oct 14, 2021

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


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.

@github-actions
Copy link

Hi @enejb! 👋

Thank you for your contribution to WordPress! 💖

It looks like this is your first pull request to wordpress-develop. Here are a few things to be aware of that may help you out!

No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description.

Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making.

More information about how GitHub pull requests can be used to contribute to WordPress can be found in this blog post.

Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook.

If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook.

The Developer Hub also documents the various coding standards that are followed:

Thank you,
The WordPress Project

@TimothyBJacobs
Copy link
Member

Thanks for the patch @enejb! We usually don't merge these until shortly before/alongside the corresponding JS. Is there a ticket for that already?

@enejb
Copy link
Author

enejb commented Oct 14, 2021

Thanks for taking a look @TimothyBJacobs

I provided a bit more context here - https://core.trac.wordpress.org/ticket/54247#comment:4
As far as I can tell the endpoint is not being used yet directly by Gutenberg. (I couldn't find any calls being made to it)

cc @gziolo Do you know if there are any plans for using the endpoint in Gutenberg directly?

We are already using the endpoint in native mobile apps already in order to allow users to edit font size and colours on some blocks.

@gziolo
Copy link
Member

gziolo commented Oct 18, 2021

Do you know if there are any plans for using the endpoint in Gutenberg directly?

In theory, we could since we print in PHP some JS code to pass the same settings to the editor. I’m not sure how the transition could look like in practice, though. @oandregal or @jorgefilipecosta, any immediate plans related to that?

@oandregal
Copy link
Member

👋 This is what I know: this endpoint landed at WordPress/gutenberg#29969 in Gutenberg and it's used by mobile, so they'd know more if it's ready to be merged in WordPress core. @WordPress/native-mobile

While the endpoint was mainly driven by mobile needs to gather "global styles" data, it can do more as it stands. It was suggested that the editors could use this endpoint, but I'm not aware of any work in this direction. Additionally, @youknowriad is proposing we use a different one for global settings & styles at WordPress/gutenberg#35141 If we do so, I wonder if mobile should use it as well. Given that this is still being talked about, I'm not sure we should merge the existing settings endpoint.

@geriux
Copy link
Member

geriux commented Oct 19, 2021

If we do so, I wonder if mobile should use it as well.

Hey @oandregal 👋 It'd be nice to use it on mobile as well since we have plans to allow modifying global styles from the app, the thing is we also use __experimentalFeatures from the block editor settings endpoint. Would this new endpoint have this data as well?

@oandregal
Copy link
Member

Would you provide your thoughts on the discussion at WordPress/gutenberg#35141? If we go that route we need to cover the two use cases we have at the moment (mobile plus the site editor).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants