Custom theme options Radio inputs not saving

Why isn’t the following option getting saved? Have been searching for quite some time and can’t get it to work. Settings code: add_settings_section( ‘aa_myoption_section’, null, null, ‘mypage-options’ ); add_settings_field( ‘aa_myoption’, null, ‘aa_myoption_interface’, ‘mypage-options’, ‘aa_myoption_section’, ); register_setting ( ‘myoptions_group’, ‘aa_myoption’ ); aa_myoption_interface function: $options = get_option( ‘aa_myoption’ ); echo ‘debug: ‘ . $options; <input id=”first_radio” type=”radio” … Read more

Settings API get_option best practices

I have a lot of options in my custom theme and most of them are like: get_option(‘my_option’)[‘depth’][‘more_depth’] as they are arrays. In order to write code in a “cleaner”, more compact way I have created a function: function my_options($key){ $options = array( ‘depth_more_depth’ => get_option(‘my_option’)[‘depth’][‘more_depth’] . . . ); return $options[$key]; } and I call … Read more

Settings Page won’t save

I’ve created a simple settings page with just one page, one section and two fields, it all displays just fine, but I can’t for the life of me figure out why it won’t save. There’s either a typo or I’m missing a whole function or something similar. My code: test-page.php <?php //add menu page with … Read more

Echo all API Settings sections?

Is there a WordPress function displaying all sections registered with add_settings_section()? I was thinking about SQL query maybe, but have absolutely no idea how and where these are stored, couldn’t find them in my database. 3 Answers 3 Use the $wp_settings_sections global. It returns an array of settings sections.

wordpress settings API and option array structure

how do you get the settings API to save options that are in an array structure like this: $array = array ( array( ‘id’=> ‘1’, ‘name’=> ‘tom’, ‘pageurl’=> ‘someurl’, ‘notes’=> ‘someNotes’ ) array( ‘id’=>’2’, ‘name’=>’harry’, ‘pageurl’=>’someotherurl’, ‘notes’=>’anothernote’ ) ); This array gets data sets added to and deleted from it by the user. The wp_list_table … Read more

settings API: how to create a multi checkbox with blog categories?

i need to create a callback function with a multi checkbox with all the web/blog categories as multi options. my add_settings_fields are: add_settings_field( ‘select_page’, ‘Select Blog Page’, / ‘journal_combo_select_page_callback’, ‘journal_theme_blog_2_col’, ‘blog_page_blog_2_col_section’ ); add_settings_field( ‘limit_posts’, ‘Limit Posts’, ‘journal_limit_posts_callback’, ‘journal_theme_blog_2_col’, ‘blog_page_blog_2_col_section’ ); add_settings_field( // $id, $title, $callback, $page, $section, $args ‘check_categories’, // $id ‘Choose Categories’, // $title … Read more

Can I use the different settings sections over different pages using the save options group?

I registered one options group with few different options sections. Each section is meant for different page. register_setting( // http://codex.wordpress.org/Function_Reference/register_setting ‘mhp_options’, // Options group ‘mhp_plugin_options’, // Database option ‘mhp_plugin_options_validate’ // The sanitization callback, ); // Manage Menu section add_settings_section( // http://codex.wordpress.org/Function_Reference/add_settings_section $mhp_manage_menu_section, // Unique identifier for the settings section __(‘Manage Menu Settings’, ‘mhp’), // Section … Read more