Skip to content

Instantly share code, notes, and snippets.

@donini
Created September 14, 2019 01:48
Show Gist options
  • Save donini/e38fb6bc8af07b55de2364b9f7f7aadc to your computer and use it in GitHub Desktop.
Save donini/e38fb6bc8af07b55de2364b9f7f7aadc to your computer and use it in GitHub Desktop.
13-run-task-before-activate-plugin.php
<?php
register_activation_hook( __FILE__, 'activation_check' );
/* Test before activate the plugin */
function activation_check() {
if ( ! is_plugin_active( 'pods/init.php' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die( 'The plugin <a href="https://www.pods.io/">PODS</a> is prerequisite to run this Plugin.</p>' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment