Skip to content

Instantly share code, notes, and snippets.

@mathetos
Created May 20, 2014 03:12
Show Gist options
  • Save mathetos/400ee828dde66e2296e2 to your computer and use it in GitHub Desktop.
Save mathetos/400ee828dde66e2296e2 to your computer and use it in GitHub Desktop.
FooBox V2 or Free check and notice
<?php
/*
* This checks whether either version of FooBox --
* Free or Premium -- is activated. If not, it throws
* An admin notification, only for users who can
* activate plugins.
*/
function fooboxnotpresent_admin_notice() {
if ( class_exists('Foobox_Free') || class_exists('fooboxV2')) {
} else {
if (current_user_can( 'activate_plugins' )) {
?>
<div class="error">
<h2>FooBox does not seem to be activated</h2>
<p>Easy Thumb Gallery basically does nothing without FooBox. <br />
Please go to "Plugins > Add New" and Search for "FooBox" to add the "FooBox Image Lightbox" plugin.</p>
</div>
<?php
}
}
}
add_action( 'admin_notices', 'fooboxnotpresent_admin_notice' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment