There are multiple ways to identify if a plugin is active (here’s one) but how can we identify if a specific JetPack component is active, for example Photon?
Leave a Reply
You must be logged in to post a comment.
There are multiple ways to identify if a plugin is active (here’s one) but how can we identify if a specific JetPack component is active, for example Photon?
You must be logged in to post a comment.
We just committed a new function to Jetpack Trunk, and it should be enabled in the next release,
Jetpack::is_module_active()
—http://plugins.trac.wordpress.org/changeset/716884
Then you can just call:
Or at least, you will once the next version releases, and the user has their Jetpack updated. 🙂 If you’d like to preserve the backward compatability, you can just do:
It’s a slightly tidier way than querying the option directly.
Checking for the option value
jetpack_active_modules
.Searching for
photon
in wp_options is how I found theoption_name
.The following prints the option as an admin notice:
The following is the result with all modules activate.
The key numbers are in the order by which the modules were activated and should not be used as reference.
( in a local host installation )