-
Notifications
You must be signed in to change notification settings - Fork 3.2k
50152 - Add all themes to API #264
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
Conversation
|
#222 has landed so it should be possible to add tests now. We should also add a |
Status was added. I added the ability to filter by inactive themes. |
|
👍 Test failure looks legit. |
|
@TimothyBJacobs Can you review again. Small note, seems like lints failing for unrelated reason |
|
that's a very odd lint issue. What happens if I do |
Good catch @TimothyBJacobs . I didn't see that you could pass an array there. I have made the logic much more simple. |
|
The new logic looks great. I think we also need to adjust the permissions check so that you can't bypass the fetching |
I have added some tests, using a data_provider, to pass different status to check permissions. This should be enough. |
|
I think we should introduce a Do you have any idea for what it would look like to switch themes? Even if we don't implement it now, I think we should consider what that API call would look like. |
|
@TimothyBJacobs I have added the I am not sure what switch_theme might look like right now. Do this PR have to tackle this? |
|
I don't think this PR needs to implement it, but I want to make sure we could with this format. Would a |
|
@TimothyBJacobs Can you re-review? I think this can land early 5.7 thanks @lukaspawlik ! |
src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php
Outdated
Show resolved
Hide resolved
src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php
Outdated
Show resolved
Hide resolved
|
Thanks for the refresh @lukaspawlik! We need to update the This still needs to be addressed:
|
src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php
Outdated
Show resolved
Hide resolved
|
@TimothyBJacobs Your feedback has been addressed in c2855ea |
|
@lukaspawlik Thanks! To clarify, only the new functions should have an |
|
Thanks @TimothyBJacobs for the feedback. My mistake with versioning - updating it as per recommendation. |
|
@TimothyBJacobs thanks for overall feedback. It's been addressed and awaiting your review. |
|
This looks good, thanks for your contribution! We're still in 5.6, so this won't be merged for a few weeks. |
|
Hey @lukaspawlik! Thanks again for working on this. I'm going to plan on merging this next week. |
…velop into fix/themes-api
…see the active theme in the unlikely case they can't edit posts.
|
Committed in https://core.trac.wordpress.org/changeset/49925, thanks again for your work on this @lukaspawlik! |
Add all themes to API
Trac ticket: https://core.trac.wordpress.org/ticket/50152
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.