Opened 4 years ago
Closed 4 years ago
#53313 closed defect (bug) (fixed)
Widgets REST API: Deleted widgets re-appear after accessing old widgets screen
Reported by: | noisysocks | Owned by: | noisysocks |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | REST API | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
From https://github.com/WordPress/gutenberg/issues/31575.
## Description
The REST API endpoint for deleting widgets does not seem to properly delete widgets.
## Step-by-step reproduction instructions
For making REST API requests, I use https://httpie.io and have the Basic Auth WordPress plugin installed, but use whatever suits you.
- Install the Classic Widgets plugin.
- Navigate to
wp-admin/widgets.php
. - Add a widget.
- Find the widget's ID by hitting
GET /wp-json/wp/v2/widgets
. - Delete the widget by hitting
DELETE /wp-json/wp/v2/widgets/{id}?force=1
. - Hit
GET /wp-json/wp/v2/widgets
. Notice the widget is gone. - Navigate again to
wp-admin/widgets.php
. Notice the widget appears in Inactive widgets. - Hit
GET /wp-json/wp/v2/widgets
. Notice the widget appears again.
## Expected behaviour
The widget should not appear in steps 6 and 7.
## Actual behaviour
The widget re-appears.
Change History (2)
This ticket was mentioned in PR #1323 on WordPress/wordpress-develop by noisysocks.
4 years ago
#1
- Keywords has-patch has-unit-tests added
Note: See
TracTickets for help on using
tickets.
The
DELETE /wp/v2/widgets/:id?force=1
endpoint was only removing widgets from the'sidebars_widgets'
option and not actually deleting the widget's options from the"widget-$id_base"
option. This PR implements widget deletion.https://core.trac.wordpress.org/ticket/53313