[wp-trac] [WordPress Trac] #35574: Add REST API JSON schema information to WP_Widget
WordPress Trac
noreply at wordpress.org
Thu Apr 6 19:31:33 UTC 2017
#35574: Add REST API JSON schema information to WP_Widget
------------------------------------------+-----------------------------
Reporter: westonruter | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Widgets | Version: 2.8
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses:
------------------------------------------+-----------------------------
Comment (by westonruter):
Call for feedback: Please see https://github.com/xwp/wp-core-media-
widgets/issues/51 and provide feedback in terms of near-term merge of
media widgets.
See method as defined in `WP_Widget_Media`: https://github.com/xwp/wp-
core-media-widgets/blob/4445e0bf78ad008af79f962b874237c67ce93968/wp-
includes/widgets/class-wp-widget-media.php#L91-L120
And in the `WP_Widget_Image` subclass: https://github.com/xwp/wp-core-
media-widgets/blob/4445e0bf78ad008af79f962b874237c67ce93968/wp-
includes/widgets/class-wp-widget-image.php#L47-L136
And then see how the widget can make use of it in the `update` method so
that the image widget subclass doesn't need to define its own `update`
method, since the parent class reads from the schema and does all of the
logic: https://github.com/xwp/wp-core-media-
widgets/blob/4445e0bf78ad008af79f962b874237c67ce93968/wp-includes/widgets
/class-wp-widget-media.php#L181-L225
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35574#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list