There are few solutions. You can use activate_plugin
and deactivate_plugin
hooks for example.
But… As far as I understand you right, you want to get notified whenever list of plugins get changed and not when a plugin is activated or deactivated.
So the easiest way will be hooking onto update_option
.
add_action('updated_option', function( $option_name, $old_value, $value ) {
if ( 'active_plugins' == $option_name ) {
// update your json file based on $value
}
}, 10, 3);
Related Posts:
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- WordPress user account activation
- register_activation_hook in oop approach
- Advanced WordPress plugin activation detection
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How To Activate Plugins via Code?
- Activate a plugin through PHPMyAdmin or FTP?
- How to check if a theme is active?
- Deactivate plugin for a specific user group
- Removing an action from an external plugin class
- How can I limit functionality in one version of a plugin?
- Which hook callback has priority if both plugin and theme use the same hook?
- Activate Plugin which is in subfolder?
- Remote plugin activation hook
- delay function on publish?
- How to prepend to the_title for admin-side plugin’s use
- How can I enqueue a style only when a particular widget is active?
- Add custom buttons with custom actions in Edit Post screen in WordPress?
- Can a plugin add to header/footer/body content?
- Multisite: Activate plugin for subsites only?
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- The plugin generated x characters of unexpected output, $wpdb not defined
- WordPress Plugin Boilerplate – add_action hook in static “activate” function
- template_redirect not being called when using ajax
- Cannot run the code after I activate the plugin
- Plugin custom Action Hook not working
- Unable to activate wordpress importer after installing it
- add_action in functions.php, do_action in plugin?
- add action for displaying posts using a shortcode
- How to Use Parameters with a Do_Action Function Within PHP Tags
- WordPress filter that hook after each action/filter hook
- How to stop or remove an action being called inside a function of an extended class
- Activated plugin is stored as an object, rather than as a path
- Insert new user with form submit ‘init’ hook
- How to block plugin activations with no known user or coming from unknown IP address range?
- Calling plugin function inside custom plugin for onclick event
- How to check current user before all actions and filters?
- CampaignMonitor for WooCommerce – Move subscribe button [closed]
- Plugin developer automated documentation
- Custom plugin init action causing general slowness
- add_action in static class [closed]
- Multiple instance of data in plugin custom database table on plugin activation
- Inject HTML meta tag inside wordpress tag using add_shortcode
- How to get post ID with hooks publish_post, new_to_publish, etc
- Problem with removing plugin action
- edit_user_profile and show_user_profile are not firing inside a class
- do add_action on condition
- get gravity form ID from backend/wordpress admin
- How to pass variables to a function argument using add_action [duplicate]
- How to trace SUBMIT button
- publish_post action doesn’t work
- the_post hook is not firing for me
- do_action Nested List
- Create a post builder skin in a plugin
- Plugin Development – Functions or Hooks?
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Basic function call on init failing
- How to create Admin Notice from Plugin with argument? [duplicate]
- Hook for page Request?
- Editing wp-config.php
- New bulk action to resend welcome emails
- How to remove a class function from a plugin by using remove_action()?
- Trying to add_action in a loop
- Retrieve options set through a plugin
- override function from my plugin [closed]
- Activate a plugin via a SQL query
- Running a function with args in add_action()
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- My plugin does not install correctly if a previous version is still installed
- Is there existing plugins to “Click-to-Launch” embedded Flash / SWF content?
- Displaying page content from plugin, inside exising empty WP page
- Hook from plugin doesn’t fire up from external PHP script
- Callback hooked to post_updated firing on new posts as well
- How to run flush_rewrite_rules on activation after i register my custom post type using WordPress Boilerplate Plugin
- The function called on the wp head hook becomes null
- Discern a specific plugin’s action hooks
- How to Unhook actions/filters in within Class in plugin
- WPML – Hook when language is switched (change user language)
- Nested Actions and Filters
- Use action, filter, or hook to append HTML to WordPress plugin function
- Passing function into add_action always returns the first argument
- Change hook to add_action in a plugin class
- echo plugin results on pages
- How to get bulk actions handler to display simple “Hello World”?
- What action or filter can I use to change all the html returned from server for a page?
- What action/hook do I need to register to have my plugin handle front-end editing?
- wp_login_form() ignoring login_form action hook
- how to repeat taxonomy in different places on wordpress
- API calls on plugin activation or init?
- Different plugins activated online and offline
- Removing this filter added by a plugin
- Which filters or actions involve with index page for plugin?
- Plugin De/Activation Not Firing On MultiSite install
- why i cannot see some plugins while they are enabled on network admin page?
- Call a function with href
- Install theme as part of a plugin
- Which action/filter can i use for a Member Plugin [closed]
- My wp_update_nav_menu action is firing twice