I cant seem to find any complete tutorial that shows how to add / save/ retrieve a fields to any widget. Can someone please show a simple example how to add a simple select , save the data and retrieve it in front.
All I got so far is this http://prntscr.com/76d051
add_action('in_widget_form', 'add_widget_fields');
function add_widget_fields(){
$html ='<select class="custom_widget_select" name="dont know">';
$html .='<option value="blue">Blue</option>';
$html .='<option value="red">Red</option>';
$html .='<option value="green">Green</option>';
$html .='</select>';
echo $html;
}
I dont know what name to use , how to retrieve it once is saved and how to display it in front for all widgets.
I just need to add simple select to display list of additional widget styles. and I would like to do this trough theme functions.php rather than creating a full blown plugin.
Any help is appreciated.