Question

I've created plugin that goes to wordpress plugin repositories. Now, I need to create another plugin (sub plugin or child plugin you may call) that require this certain plugin to be already installed and activated.

I know I can use register_activation_hook. However, how do I check using that hook? Or, maybe there's another solution exists?

Was it helpful?

Solution

There is is_plugin_active() function.

Other method is to check if functions or classes, specific to required plugin, exist. Some plugins explicitly define their own constants for this, typically with version number and/or other identifying info.

There has been some developments to make extension dependence logic more generic, such as Plugin Dependecies, but they hadn't gained widespread adoption so far.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top