desrosj
636f00b5f2
REST API: Add the $request parameter to methods checking permissions.
...
This adds the `$request` parameter to the permissions_check() methods within `WP_REST_Widgets_Controller` and adds $request as an allowed parameter to the `permissions_check()` method within `WP_REST_Templates_Controller`.
Even when this parameter is not used by default, it should be implemented to support the class being extended and the method overridden.
Props johnbillion, timothyblynjacobs.
Merges [51349] to the 5.8 branch.
Fixes #53593 .
Built from https://develop.svn.wordpress.org/branches/5.8@51350
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 15:56:59 +00:00
desrosj
aacf626adf
Docs: Remove an empty line between @param and @return tags in some newly added REST API methods, per the documentation standards.
...
Follow-up to [48242], [49925], [51003], [51021].
Props SergeyBiryukov.
Merges [51289] to the 5.8 branch.
See #52628 , #53461 .
Built from https://develop.svn.wordpress.org/branches/5.8@51317
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-02 19:04:56 +00:00
desrosj
8d871746a4
Docs: Document the globals used in WP_REST_Widget_Types_Controller and WP_REST_Widgets_Controller.
...
Follow-up to [50995].
Props SergeyBiryukov.
Merges [51279] to the 5.8 branch.
See #52628 , #53461 .
Built from https://develop.svn.wordpress.org/branches/5.8@51310
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-02 18:53:00 +00:00
desrosj
337cfb97c1
REST API: Allow multiple widgets to be deleted in a single batch request.
...
This resets the `WP_Widget::$updated` flag when deleting a widget, to avoid blocking all future updates in a request.
Props noisysocks, andraganescu.
Merges [51277] to the 5.8 branch.
Fixes #53557 .
Built from https://develop.svn.wordpress.org/branches/5.8@51290
git-svn-id: http://core.svn.wordpress.org/branches/5.8@50899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 18:47:01 +00:00
noisysocks
7131a90b0a
Widgets REST API: Fix non-multi widgets not appearing in wp_inactive_widgets
...
Registered widgets that do not extend WP_Widget should appear in the
wp_inactive_widgets sidebar by default. Having the widgets REST API call
retrieve_widgets() before serving any request ensures that this will happen.
This is a similar fix to [51235].
Fixes #53534 .
Props zieladam, timothyblynjacobs.
Built from https://develop.svn.wordpress.org/trunk@51248
git-svn-id: http://core.svn.wordpress.org/trunk@50857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-28 04:34:57 +00:00
desrosj
49a6a14915
REST API: Include the sidebar ID when saving a widget.
...
This ensures backwards compatibility for code expecting this field to be present.
Props strategio, noisysocks, spacedmonkey.
See #53452 .
Built from https://develop.svn.wordpress.org/trunk@51239
git-svn-id: http://core.svn.wordpress.org/trunk@50848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 15:25:59 +00:00
Sergey Biryukov
47231831f7
REST API: Restore the $creating parameter of rest_after_save_widget action.
...
This is consistent with other similar REST API actions.
Partially reverts [51071], except for DocBlock formatting fixes.
Props TimothyBlynJacobs.
See #53317 .
Built from https://develop.svn.wordpress.org/trunk@51074
git-svn-id: http://core.svn.wordpress.org/trunk@50683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 23:13:59 +00:00
Sergey Biryukov
36cf03ca52
REST API: Rename the $creating parameter of rest_after_save_widget action to $update.
...
This brings some consistency with similar actions for posts, e.g. `save_post` or `wp_insert_post`.
Follow-up to [51068], [51069].
See #53317 .
Built from https://develop.svn.wordpress.org/trunk@51071
git-svn-id: http://core.svn.wordpress.org/trunk@50680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 10:48:56 +00:00
noisysocks
222541d7c3
REST API: Delete fresh_site option when updating widgets via REST API
...
Adds new hooks (rest_save_sidebar, rest_delete_widget, rest_after_save_widget)
to the widgets REST API and uses them to delete the fresh_site option when
updating widgets via the REST API. This ensures that starter content isn't
loaded in the Customizer after a user makes changes.
Fixes #53317 .
Props kevin940726, garrett-eclipse, andraganescu, hellofromtonya.
Built from https://develop.svn.wordpress.org/trunk@51068
git-svn-id: http://core.svn.wordpress.org/trunk@50677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 00:45:56 +00:00
noisysocks
5162c8e6a8
REST API: Add 'delete_widget' action to delete widget endpoint
...
Triggers the 'delete_widget' action to the delete widget endpoint in the REST
API. This aligns with the behaviour in the widgets WP Admin screen.
Fixes #53289 .
Props isabel_brison, TimothyBlynJacobs.
Built from https://develop.svn.wordpress.org/trunk@51060
git-svn-id: http://core.svn.wordpress.org/trunk@50669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 01:40:57 +00:00
noisysocks
2fd3f23408
REST API: Fix delete widget endpoint
...
Makes the `DELETE /wp/v2/widgets/:id?force=1` endpoint actually delete the
widget from the `"widget-$id_base"` option and not just remove it from
`'sidebars_widgets'`.
Fixes #53313 .
Props TimothyBlynJacobs.
Built from https://develop.svn.wordpress.org/trunk@51059
git-svn-id: http://core.svn.wordpress.org/trunk@50668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 01:22:57 +00:00
noisysocks
1314542c50
REST API: Add widget endpoints
...
Adds the sidebars, widgets and widget-types REST API endpoints from the
Gutenberg plugin.
Fixes #41683 .
Props TimothyBlynJacobs, spacedmonkey, zieladam, jorgefilipecosta, youknowriad, kevin940726.
Built from https://develop.svn.wordpress.org/trunk@50995
git-svn-id: http://core.svn.wordpress.org/trunk@50604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 08:27:57 +00:00
noisysocks
ed195fbd89
REST API: Revert widget endpoints
...
Reverts [50993] as it has missing props.
Reverts [50993].
See #41683 .
Built from https://develop.svn.wordpress.org/trunk@50994
git-svn-id: http://core.svn.wordpress.org/trunk@50603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 08:22:56 +00:00
noisysocks
2a4e1e0c04
REST API: Add widget endpoints
...
Adds the sidebars, widgets and widget-types REST API endpoints from the
Gutenberg plugin.
Fixes #41683 .
Props TimothyBlynJacobs.
Built from https://develop.svn.wordpress.org/trunk@50993
git-svn-id: http://core.svn.wordpress.org/trunk@50602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 07:52:55 +00:00