Created
May 20, 2014 03:12
-
-
Save mathetos/400ee828dde66e2296e2 to your computer and use it in GitHub Desktop.
FooBox V2 or Free check and notice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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