1

I want to create an custom plugin for woocommerce features so it is a dependent plugin so i need trigger an error that it requires woocommerce plugin and the plugin should not be activated if woocommerce plugin is not activated, please help

2
  • I expect there are plenty of existing plugins that do this that you can copy? I'd add an admin_init hook that checks if one of the WooCommerce classes exists - I'm not sure which to recommend - and if not add an admin_notices hook to output some warning HTML.
    – Rup
    Apr 3 '20 at 13:33
  • 2
    Does this answer your question? How to make a plugin require another plugin?
    – BenB
    Apr 3 '20 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.