Use the Settings API to whitelist a setting, but don’t output it
You should use register_setting() to whitelist an option. It won’t affect the UI at all. register_setting( ‘my_option_group’, ‘my_option’, ‘optional_sanitize_callback’ );
You should use register_setting() to whitelist an option. It won’t affect the UI at all. register_setting( ‘my_option_group’, ‘my_option’, ‘optional_sanitize_callback’ );
So having another look at this again today it occurred to me that it definitely must be an issue with settings_opts_page. In the light of a new day the answer is obvious, clearly settings_fields and do_settings_sections are intended to echo their contents and this is breaking the page render and seeing the form and contents … Read more
Setting aren’t registered in the database by plugin, though a plugin should be using an identifying prefix. That is, there is no specific queryable cross-linking in the database between plugin and setting. The only way to way to pull all settings for a plugin is to know what keys the plugin has used to save … Read more
I used the $input[‘user_custom_text’]; all I needed was $_POST[‘user_custom_text’]; also to get the media to work need wordpress Sanitize: <?php wp_kses_post( $data ); ?> http://codex.wordpress.org/Function_Reference/wp_kses_post
I don’t know anything about the WeDevs thing, but I do kinda know the Settings API itself. That being said I have a shot in the dark answer. In your wedevs_plugin_page() function, do the methods on the $settings_api object need a parameter for which settings section to display? Like $settings_api->show_navigation(‘wedevs_basic’);? Or maybe the object instantiation … Read more
It would be good if you added your code to see more or less what you want to do. You can not pass it that way, because when using the Settings API you must add fields of a single value and are registered with the function add_settings_field(). I do not understand very well what you … Read more
Looks like update_option_{$option} will only fire on updated options, ie, not brand-new ones. Reading the code for update_option(), I see this: /** This filter is documented in wp-includes/option.php */ if ( apply_filters( “default_option_{$option}”, false, $option, false ) === $old_value ) { // Default setting for new options is ‘yes’. if ( null === $autoload ) … Read more
Because the group is not the same as a category or taxonomy. It’s used to determine where that settings UI control is displayed in the WP Admin area. e.g. the value general is for the general settings admin screen, not because it’s a general options group. Until the introduction of the settings endpoint and the … Read more
The escaping function is adding it, esc_url guarantees that what it returns will be a URL, as it’s an escaping function, and so it should, if you’re outputting a URL you should use esc_url so that it’s safe and definitely a URL and not something else maliciously snuck in. The confusion here though, is that … Read more
The options are not being saved correctly because you used the wrong input name — it should match the second parameter for register_setting(). So for example, with register_setting(‘myplugin_options_group’, ‘api_username’), the input name should be api_username, but then you used myplugin_api_username. Additionally, it should be noted that screen_icon() has long been deprecated.