Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run extension deactivation actions when WordPoints is deactivated #712

Open
JDGrimes opened this issue Aug 10, 2017 · 1 comment
Open

Run extension deactivation actions when WordPoints is deactivated #712

JDGrimes opened this issue Aug 10, 2017 · 1 comment

Comments

@JDGrimes
Copy link
Member

When an extension is deactivated, an action is fired that the extension can hook into to run certain code on deactivation. For example, it is common practice to deregister any cron jobs on deactivation, since they don't need to run and the callback function won't be loaded. These jobs then need to be registered again on reactivation.

However, when WordPoints itself is deactivated, the deactivation code for the extensions is not automatically triggered. The extension could hook into the plugin's deactivation action as well as it's own deactivation action. But should it really have to do that manually? Shouldn't WordPoints be responsible for triggering these actions automatically? And then shouldn't it likewise run the activation hooks for the active extensions on reactivation? (The extensions wouldn't actually be activated/deactivated, we'd just be running the actions.)

@JDGrimes
Copy link
Member Author

The same could also be said for components, especially since they are mainly internal to begin with. However, the core components are not actually hooking into their de/activation at all right now, so the point is largely moot at the moment.

JDGrimes added a commit that referenced this issue Sep 20, 2017
Instead just use a filter that we introduce (
`'is_wordpoints_extension_active`).

This is better, because the deactivation only takes care of the current
site on multisite anyway.

It also avoids having to call `is_wordpoints_network_active()` within or
triggered by that function, which is unreliable during uninstall.

See #399, #712
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant