Skip to content

Instantly share code, notes, and snippets.

@emre-edu-tech
Last active December 5, 2023 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emre-edu-tech/b2203f09191b14ea679eb1491d77be72 to your computer and use it in GitHub Desktop.
Save emre-edu-tech/b2203f09191b14ea679eb1491d77be72 to your computer and use it in GitHub Desktop.
Shortcode to check if a plugin is active. In this example, a plugin with the directory name and main plugin file is used.
<?php
add_shortcode('check_if_scraper_plugin_is_active', function() {
if(is_plugin_active('product-scraper/product-scraper.php')) {
return true;
} else {
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment