deactivating an active plugin using if page

Good day! just wondering if you can help me out? I was trying to create a code for functions.php if the user currently lands on a specific page, thus the plugin will turn deactivated, but if the user re jumps on other pages, the plugin would be re activated.

Here’s my code.

function disable_plugins(){
if( is_page(2690) ) {
deactivate_plugins( ‘/popup-maker/popup-maker.php’);
} else {
//reactivate the plugin
}
} add_filter(‘option_active_plugins’, ‘disable_plugins’);

Read more here:: deactivating an active plugin using if page

Leave a Reply

Your email address will not be published. Required fields are marked *