Opened 3 years ago
Closed 3 years ago
#53305 closed defect (bug) (fixed)
REST API: Duplicate widget types in /wp/v2/widget-types
Reported by: | noisysocks | Owned by: | TimothyBlynJacobs |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | REST API | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description (last modified by )
The /wp/v2/widget-types
endpoint is returning duplicate widget types which causes the issue described in https://github.com/WordPress/gutenberg/issues/32019.
Using https://httpie.io:
$ http -a admin:password GET http://wp-git-build.test/wp-json/wp/v2/widget-types | jq '.[].id' "pages" "calendar" "archives" "media_audio" "media_image" "media_gallery" "media_video" "meta" "search" "search" "text" "categories" "recent-posts" "recent-comments" "rss" "tag_cloud" "nav_menu" "custom_html" "block" "block" "block" "block" "block" "block" "block" "block" "block" "block" "block" "block" "block" "block"
Change History (5)
This ticket was mentioned in PR #1317 on WordPress/wordpress-develop by noisysocks.
3 years ago
#2
- Keywords has-patch has-unit-tests added
Note: See
TracTickets for help on using
tickets.
Modifies the
/wp/v2/widget-types
endpoint to de-duplicate widget types by their id. Duplicates appear becauseWP_Widget::_register
will add one entry to$wp_registered_widgets
per widget instance.Trac ticket: https://core.trac.wordpress.org/ticket/53305