Quantcast
Viewing all articles
Browse latest Browse all 22091

chirag740 on "Deactivate a plugin via theme functions.php"

In my WP install, I am loading different themes as per user-agent.
I wish to deactivate a plugin for mobile users.

The path of plugin is:
~/public_html/wp-content/plugins/myplugin/myplugin.php

Therefore I placed the following in my theme's functions.php
deactivate_plugins('/wp-content/plugins/woocommerce-cart-tab/cart-tab.php')

But it breaks the website.
Is this the correct way to accomplish this?


Viewing all articles
Browse latest Browse all 22091

Trending Articles