3

I am looking for a way to track which user activates or deactivates a plugin for logging purposes. I've been searching around, but can only find information for plugin developers to have a hook to (de)activate their own plugin, but I want to be able to track which plugins are (de)activated from my theme or otherwise my own plugin.

Is there a generic hook for when a plugin gets (de)activated?

2

do_action( 'deactivate_' . $plugin, $network_deactivating );

Fires as a specific plugin is being deactivated.

do_action( 'deactivated_plugin', $plugin, $network_deactivating );

Fires after a plugin is deactivated.

The above hooks don't fire when silent mode is activated (eg: during an update).

Refer:

deactivated_plugin

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.