Getting all the settings for a plugin

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

settings api sub menu and data not populating

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

update_option_$option action not working as expected

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

input on custom settings page adds http://

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

Why aren’t these WordPress options being saved to the database correctly?

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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)