add_option_{$option} action hook not being called
add_option_{$option} action hook not being called
add_option_{$option} action hook not being called
Ended up using jQuery to do this. There might be a better way, but this works: jQuery(“input[name=_wp_http_referer]”).val(‘admin.php?page=plugin_settings_page’)
For the if True section. This code is saving into the network-wide “host” option the value of the posted host-url argument from the settings page. For the else section of code. the register_setting() is registering for the option-group ‘my_settings’ on the settings page it would need to have add_settings_section() and add_settings_field() to become part of … Read more
From the settings API, add_settings_field( ‘my_first_field-id’, ‘This is the setting title’, ‘myprefix_setting_callback_function’, ‘general’, ‘myprefix_settings-section-name’, array( ‘label_for’ => ‘my_first_field-id’ ) ); myprefix_setting_callback_function(){ echo ‘<input type=”text” name=”my_first_field” value=”‘.get_option(‘my_first_field’).'” />’; }
Add Logo Upload per Setting API
get_option(‘show_season_title_’ . $k); I think, I don’t have a way to test that right now but it should work.
If you are use add_menu_page() or add_submenu_page() to add setting pages,Try add this function in your code: settings_errors();
You are missing _ in add_control paramater: settings. The settings parameter should be home_features_boxes_icon_’ . $i Full code here: for ( $i = 1; $i < 7; $i++ ) : $wp_customize->add_setting( ‘home_features_boxes_icon_’ . $i, array( ‘default’ => ”, ‘type’ => ‘theme_mod’, ‘capability’ => ‘edit_theme_options’, ‘sanitize_callback’ => ‘esc_html’, ) ); $wp_customize->add_control( ‘home_features_boxes_icon_’ . $i . ‘_c’, … Read more
Try this: $mapScript = ( get_option(‘style-radio’) === 1 ) ? “ESRI.js” : “Google.js”; wp_enqueue_script( ‘Map’, get_template_directory_uri() . ‘/js/’ . $mapScript );
How do I add a textarea (multirow) option to my WordPress plugin?