WP-API / menus-endpoints

Feature plugin for Menu Endpoints
43 stars 12 forks source link

Use WP_Widget::get_settings() instead of global #16

Closed NateWr closed 8 years ago

NateWr commented 8 years ago

Implements this comment.

Also switches to using $instance rather than $widget to differentiate widget types from specific instances.

Making the switch to WP_WIdget::get_settings() required mushing a bit of data together in an ad-hoc way. You may have some better ideas, but I thought it best to store all the data inside one object so we don't have to pass too many vars around to the different methods.

I'm also a little nervous about array key clashes here. If a widget has a setting named id or type it will break. Should the schema validation loop be run on a separate array and then we handle id and type properties manually?