Function to deactivate plugins on devices
-
Hi there!
Thanks for this great plugin, with any luck this will be JUST what I was looking for!
I’m trying to write a function to disable a specific plugin on mobile devices, as this plugin creates an iframe that devices are unable to scroll. I’ve tried fixing the problem via CSS, and now it seems disabling the plugin itself is a much better solution. Here is my code:
function deactivate_plugin_conditional() { if ( wpmd_is_device() ) { deactivate_plugins('audiobar/audiobar.php'); } } add_action( 'admin_init', 'deactivate_plugin_conditional' );
I’m no expert in PHP, and this is something I cobbled together from various things I’ve read, so it may be the code itself that is causing the problem. I’ve tried placing this in several PHP files (theme functions, wp config, index, etc.) and no luck.
So my question is – am I using the function from your plugin correctly? Any suggestions on how I might get this to work?
Thanks so much!
Rory
- The topic ‘Function to deactivate plugins on devices’ is closed to new replies.