I\'m using Tom McFarlin\'s WordPress-Plugin-Boilerplate along with JoeSz\'s Tutorial.
I\'m loading in a complex options item using
$options = get_option($this->plugin_name);
This works fine for the load and for accessing the items. What I don\'t understand as yet is how to update the modified options back into the db.
For example, if I update the $options
blob with
$options[\'stamp1\'] = (isset($input[\'stamp1\']) && !empty($input[\'stamp1\'])) ? esc_attr($input[\'stamp1\']) : (new DateTime(\'NOW\'))->format(\'c\');
$options[\'stamp2\'] = (isset($input[\'stamp2\']) && !empty($input[\'stamp2\'])) ? esc_attr($input[\'stamp2\']) : (new DateTime(\'NOW\'))->format(\'c\');
$options[\'stamp3\'] = (isset($input[\'stamp3\']) && !empty($input[\'stamp3\'])) ? esc_attr($input[\'stamp3\']) : (new DateTime(\'NOW\'))->format(\'c\');
$options[\'stamp4\'] = (isset($input[\'stamp4\']) && !empty($input[\'stamp4\'])) ? esc_attr($input[\'stamp4\']) : (new DateTime(\'NOW\'))->format(\'c\');
the documentation for update_option makes it\'s obvious that
update_option($this->plugin_name );
isn\'t going to work.
There is a register_setting
in my class-...-public.php
but it\'s not particularly obvious (to me anyway) how this gets called and whether it\'s actually updating the options in the db.
Clues?