Category Archives: Code Snippets

Small code pieces that can be added to WordPress them or plugin files to achieve a particular function.

Auto Deactivate a Plugin on Another Plugin Activation

It is sometimes needed to deactivate a certain plugin while your plugin is being activated. The reason for it can be anything, like if two plugins are incompatible or if you are providing premium version of a free or lite plugin. So while activating the premium version you can automatically deactivate the free or lite version in the activation hook of the premium plugin.

Save Plugin or Theme Setting Options using AJAX in WordPress

Almost all of the WordPress plugins provide Plugins specific Options or Settings which provide an ability to the plugin user to change the default behavior of the plugin or specify some site specific values. You can very easily implement the Save Settings using AJAX functionality on your plugins Option Panel using this small code snippet.