I am writing a set of classes to easily create options pages accessible via submenus of the standard WordPress menus and a way to easily create options for said menus. The way I am wiring it is via a settings class which you pass settings to and I intend to have it work along with a submenu class to create the menu, settings page and store the options neatly in a single option. The option is getting created in the database -- but nothing is being stored in the option. Can anyone lead me in the right direction? Here is my code:

It works if I change $options[$id] to get_option($id) but this saves each individual setting to its own individual setting in the database which is wildly inefficient. I've error_logged $page, $section_id right before the register_setting call and everything is as it should be which leaves me baffled.

1 Answer
1

You have the name parameters set to "$id" which means that they'll be things like "show_header_2" and such. You actually want them to be "second_section[show_header_2]" and similar instead, so that the array of settings is what you get back from the form.