0

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

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

1 Answer 1

3

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.

1
  • I've been looking at this and it seems about right. I've noticed a number of themes (free and paid) that tell you to download/install/activate the associated plugin separately. I thought is was a bit odd but seems quite common and appears to be the way to do it. I've seen no articles yet that indicate (easily) that this can be done
    – djack109
    Commented Jun 19, 2020 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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