-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 get_item_schema function to WP_REST_Widget_Areas_Controller #15981
Add get_item_schema function to WP_REST_Widget_Areas_Controller #15981
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the endpoint now has a schema, the args should ideally be provided by ::get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE )
when registering the update_item
route.
6bcaa78
to
3145ffb
Compare
@TimothyBJacobs Would you be able to give a fresh review here after the latest changes? |
The schema looks good to me, but the |
09b67ed
to
79467ce
Compare
Hi @TimothyBJacobs thank you for the feedback your suggestion was applied 👍 |
@jorgefilipecosta I think there is an issue with the
An example from the posts controller.
|
@jorgefilipecosta Do you want me to push the changes up for this? |
Hi @TimothyBJacobs sorry for the delay I had some AFK days, I will soon update this PR. |
79467ce
to
46b93b7
Compare
Hi @TimothyBJacobs, thank you for the review. The issue identified was fixed.
|
Suggestions were applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Description
Fixes: #15902
This PR implements the get_item_schema function for WP_REST_Widget_Areas_Controller class.
This fixes a problem where warnings were being displayed during wp-cli usage.
Props to @n9yty, @TimothyBJacobs, and @lkraav for providing valuable information that allowed this fix.
How has this been tested?
I executed wp CLI shell again a WordPress instance running Gutenberg master. Using wp shell --path=/MY/WP/PATH
I verified no error were thrown on master I got:
Warning: Invalid argument supplied for foreach() in /Users/pc/dev/core/wordpres-develop/build/wp-includes/rest-api/endpoints/class-wp-rest-controller.php on line 287
Warning: Invalid argument supplied for foreach() in /Users/pc/dev/core/wordpres-develop/build/wp-includes/rest-api/endpoints/class-wp-rest-controller.php on line 287