Theme options: Display ID of page options
Theme options: Display ID of page options
Theme options: Display ID of page options
It’s because you have typos in your code : in the function called header_logo_validate() it should be : return $new_input; EDIT: add_action( ‘admin_menu’, ‘ec1_admin’, 10, 0 ); args are useless just write add_action( ‘admin_menu’, ‘ec1_admin’); EDIT 2 : This is not a correct way to add several fields. You should put this into arrays or … Read more
Since I’m getting no answers, here’s the workaround I ended up using in case anyone runs into the same issue. I added a hidden field for each checkbox with the key as the value, then in the sanitisation function I simply check for the hidden field instead of the checkbox so I can tell wether … Read more
I think you have to solve this with jQuery. If checked -> addClass, if not -> removeClass. Here’s how to enqueue your JS file: add_action(‘admin_menu’, ‘fwds_plugin_settings’); function fwds_plugin_settings() { $hook = add_menu_page( ‘Price Display’, ‘Price Display’, ‘add_users’, ‘fwds_settings’, ‘fwds_display_settings’ ); add_action( “admin_print_scripts-$hook”, ‘fwds_print_scripts’ ); } function fwds_print_scripts() { wp_register_script( ‘my-fx’ , plugin_dir_url( __FILE__ ) . … Read more
Use the Settings API or hook a function to admin_init that checks permissions and nonces, saves the updated values and redirects to your settings page.
Your form doesn’t contain the fields you think it does. Use FireBug or a similar tool (even var_dump($_POST)) to see what is actually being posted. Your num_users is a setting group, not a single field. At best the field with the value will be user_main_settings field. The previous commenter is also correct – checking for … Read more
I was able to find the answer!! The problem I was having was having multiple forms being submitted to the options database. I found a tutorial that solved this problem: WordPress Settings API: Multiple Forms On Same Page http://www.mendoweb.be/blog/wordpress-settings-api-multiple-forms-on-same-page/
Plugin settings checkbox
Just tested your code, found an error in the input name. Change currency_options_group to currency_options will make it work. The modified code: add_action(‘admin_init’, ‘currency_options_set’); add_action( ‘admin_menu’, ‘admin_menu’ ); function admin_menu () { add_options_page( ‘Currency Options’,’Currency Options’,’manage_options’,’options_currency’, ‘settings_page’ ); } function currency_options_set(){ register_setting( ‘currency_options_group’, ‘currency_options’ ); } function settings_page () { $default_options = array( ‘currency_eur’ => … Read more
Settings API Multiple Checkbox in General Settings