Changing plugin options from theme functions file?

For reference, you may want to read the update_option documentation. The arguments you are passing are completely unrelated. However, your third technique is the closest, you have to update all the options in the the update_option call, not just the one option you want. This is because of how the plugin is storing it’s options … Read more

WordPress get_option() on AJAX issue

Well, for anyone that might need this in the future. Woocommerce overrides the get_option() method with this line: add_filter(‘option_woocommerce_currency_pos’, array($this, ‘filter_currency_position_option’)); Which then calls filter_currency_position_option The first few lines of this method are: function filter_currency_position_option($value){ global $pagenow; if( ( is_ajax() || ( $pagenow == ‘post-new.php’ && isset( $_GET[‘post_type’] ) && $_GET[‘post_type’] == ‘shop_order’ ) ) … Read more

Every time I save my plugin options it erases another plugin options

The add_options_page() adds an option page under Settings menu. It does not add an option. You’re registering your settings/options using other functions. Either add_option(), add_settings_field() or register_setting(). Both your options are saved with the same option name, thus overriding each other. You need to save each of them with different option names.

update_option in WordPress AJAX

Your first chunk of code is PHP, the second is javascript. Here is how a full example might look: In PHP (your theme’s functions.php file or a plugin file): //First enqueue your javascript in WordPress function your_prefix_enqueue_scripts(){ //Enqueue your Javascript (this assumes your javascript file is located in your plugin in an “includes/js” directory) wp_enqueue_script( … Read more

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