sc0ttkclark / wordpress-fields-api

The 2024 Fields API proposal for WordPress Core
https://make.wordpress.org/core/tag/fields-api/
361 stars 42 forks source link

Implementation: Widget forms #27

Closed sc0ttkclark closed 1 year ago

sc0ttkclark commented 9 years ago
sc0ttkclark commented 9 years ago

Need to assign to Nicholas when I get his username

sc0ttkclark commented 9 years ago

@nicholasio feel free to update the task list on this one

nicholasio commented 9 years ago

Ok, I'll look into this today and try to get some insights till monday

sc0ttkclark commented 8 years ago

Posting this here for posterity -- https://github.com/nicholasio/wordpress-fields-api/blob/implementation/widgets/implementation/widgets.php

sc0ttkclark commented 8 years ago

From @nicholasio:

based on your user-fields implementations before outputting the controls, I’ll use the helper methods of the widgets class to define the name and the id's of the control, because this will make easier to save the data, as the data will come through $new_instance, and I’ll only need to sanitise the data

sc0ttkclark commented 8 years ago

@nicholasio

I looked over your widget code and I think there’s some more things we can do:

  1. Add a new class like WP_Widget_Fields_API or something, which extends the WP_Widget base class, so we can add some more object oriented code
  2. saving / etc is now done in the user implementation, you can see that for what you need to do there
nicholasio commented 8 years ago

Initial PR here: #69