Make WordPress Core

Opened 4 years ago

Last modified 4 months ago

#41683 new feature request

Add Widget REST API endpoint

Reported by: spacedmonkey Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: needs-patch needs-unit-tests
Focuses: rest-api Cc:


There needs to be a REST endpoint to interacts with widgets. Current users can use the options api to interact with the data, but this is extremely limited. I would recommend that we look to WP CLI for pointer on how the api is laid out. Docs can be found here - https://developer.wordpress.org/cli/commands/widget/ .

One of the likely issues with if the is a view, how the html for a widget is rendered.

Change History (8)

#2 @wonderboymusic
4 years ago

getting a widget by itself may be useful for admin screens, but to build a front end, you actually need access to Sidebars. See something I am using here: https://highforthis.com/wp-json/graphql/v1/sidebars

Without the sidebar context and a representation of the widget HTML, how useful is the data?

#3 @joehoyle
3 years ago

We have the repo https://github.com/WP-API/wp-api-menus-widgets-endpoints for adding this as a feature plugin, so I don't think we need to manage and do this in trac.

This ticket was mentioned in Slack in #core-restapi by timothybjacobs. View the logs.

19 months ago

#5 @TimothyBlynJacobs
19 months ago

  • Type changed from defect (bug) to feature request

#6 @TimothyBlynJacobs
19 months ago

This looks to be something that the Gutenberg team is actively working on: https://github.com/WordPress/gutenberg/issues/13204

Work should probably be happening there for now.

This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.

4 months ago

Note: See TracTickets for help on using tickets.