Note that there are some explanatory texts on larger screens.

plurals
  1. PODeactivate WordPress Plugin if URL is
    text
    copied!<p>I have installed SMS Validator so everyone who register to my site must enter there phone number to sign-up</p> <p>Now I have created a new function (link) to add a different type user role if users sign-up by visit this link: <a href="http://example.com/wp-login.php?action=register&amp;role=vip_member" rel="nofollow">http://example.com/wp-login.php?action=register&amp;role=vip_member</a></p> <p>I want to turn OFF SMS Validator ONLY for this URL link.</p> <p>Is it possible to do it somehow?</p> <hr> <p>Success so far using mathielo code:</p> <pre><code>// Activate SMSGlobal function activate_plugin_conditional() { if ( !is_plugin_active('sms-validator-SMSG/sms-validator.php') ) { activate_plugins('sms-validator-SMSG/sms-validator.php'); } } // Deactivate SMSGlobal function deactivate_plugin_conditional() { if ( is_plugin_active('sms-validator-SMSG/sms-validator.php') ) { deactivate_plugins('sms-validator-SMSG/sms-validator.php'); } } // Now you in fact deactivate the plugin if the current URL matches your desired URL if(strpos($_SERVER["REQUEST_URI"], '/wp-login.php?action=register&amp;role=vip_member') !== FALSE){ // Calls the disable function at WP's init add_action( 'init', 'deactivate_plugin_conditional' ); } if(strpos($_SERVER["REQUEST_URI"], '/wp-login.php?action=register&amp;role=seller') !== FALSE){ // Calls the enable function at WP's init add_action( 'init', 'activate_plugin_conditional' ); } if(strpos($_SERVER["REQUEST_URI"], '/wp-login.php?action=register&amp;role=provider') !== FALSE){ // Calls the enable function at WP's init add_action( 'init', 'activate_plugin_conditional' ); } </code></pre> <p>So far this code helps me to activate and deactivate this plugin in this 3 selected URLs. But I want this plugin to be activated if is deactivated in this links: <strong>/wp-login.php</strong> and <strong>/wp-login.php?action=register</strong></p> <p>But if I set it to activate on URL: /wp-login.php then it will not be deactivated on URL: /wp-login.php?action=register&amp;role=vip_member where I need it to be deactivated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload