I need it to be so as for when the theme is activated, the plugin is automatically activated and deactivated theme =deactivated plugin

  • 2
    Can you provide more context? A theme is meant to be purely visual/aesthetic, with plugins providing theme agnostic functionality – Tom J Nowell Mar 5 '18 at 16:26

If a plugin is essential part of the theme it should be shipped as part of the theme and not as a separate plugin.

In theory, there is no way to do what you want without getting users surprised and upset when they want to use the plugin but not the theme. In practice, you can hack something but this is a bad idea with possible surprising edge cases you will not like to handle.

Best that can be done, is to notify the user that he needs to activate the plugin when the theme is active.

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.