Skip to main content
added 25 characters in body; edited tags; edited title
Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

Disable plugin If slug contains spesificspecific word

I want that If Slug contains "revslider" word, deactivate some plugins and If slug doesnt contain this word, again activate plugin automatically.

I searched in Google and wrote this code (I am not a developer).


$url = $_SERVER["REQUEST_URI"];

$isItSlide = strpos($url, 'revslider');

if ($isItSlide!==false) {
    deactivate_plugins( '/resize-image-after-upload/resize-image-after-upload.php' );
} else {
    activate_plugins( '/resize-image-after-upload/resize-image-after-upload.php' );
}

$url = $_SERVER["REQUEST_URI"];

$isItSlide = strpos($url, 'revslider');

if ($isItSlide!==false) {
    deactivate_plugins( '/resize-image-after-upload/resize-image-after-upload.php' );
} else {
    activate_plugins( '/resize-image-after-upload/resize-image-after-upload.php' );
}

If I use this code, it works in first step, Plugin can disable, but it doesnt activate again in other pages.

Disable plugin If slug contains spesific word

I want that If Slug contains "revslider" word, deactivate some plugins and If slug doesnt contain this word, again activate plugin automatically.

I searched in Google and wrote this code (I am not a developer).


$url = $_SERVER["REQUEST_URI"];

$isItSlide = strpos($url, 'revslider');

if ($isItSlide!==false) {
    deactivate_plugins( '/resize-image-after-upload/resize-image-after-upload.php' );
} else {
    activate_plugins( '/resize-image-after-upload/resize-image-after-upload.php' );
}

If I use this code, it works in first step, Plugin can disable, but it doesnt activate again in other pages.

Disable plugin If slug contains specific word

I want that If Slug contains "revslider" word, deactivate some plugins and If slug doesnt contain this word, again activate plugin automatically.

I searched in Google and wrote this code (I am not a developer).

$url = $_SERVER["REQUEST_URI"];

$isItSlide = strpos($url, 'revslider');

if ($isItSlide!==false) {
    deactivate_plugins( '/resize-image-after-upload/resize-image-after-upload.php' );
} else {
    activate_plugins( '/resize-image-after-upload/resize-image-after-upload.php' );
}

If I use this code, it works in first step, Plugin can disable, but it doesnt activate again in other pages.

Source Link

Disable plugin If slug contains spesific word

I want that If Slug contains "revslider" word, deactivate some plugins and If slug doesnt contain this word, again activate plugin automatically.

I searched in Google and wrote this code (I am not a developer).

$url = $_SERVER["REQUEST_URI"];

$isItSlide = strpos($url, 'revslider');

if ($isItSlide!==false) {
    deactivate_plugins( '/resize-image-after-upload/resize-image-after-upload.php' );
} else {
    activate_plugins( '/resize-image-after-upload/resize-image-after-upload.php' );
}

If I use this code, it works in first step, Plugin can disable, but it doesnt activate again in other pages.