Skip to content

Instantly share code, notes, and snippets.

@fatihtoprak
Created February 9, 2013 00:11
Show Gist options
  • Save fatihtoprak/4743088 to your computer and use it in GitHub Desktop.
Save fatihtoprak/4743088 to your computer and use it in GitHub Desktop.
<?php
add_action('admin_notices', 'showAdminMessages');
function showAdminMessages()
{
$plugin_messages = array();
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
// Download the Yoast WordPress SEO plugin
if(!is_plugin_active( 'wordpress-seo/wp-seo.php' ))
{
$plugin_messages[] = 'This theme requires you to install the Yoast WordPress SEO plugin, <a href="http://wordpress.org/extend/plugins/wordpress-seo/">download it from here</a>.';
}
// Download the Disqus comment system
if(!is_plugin_active( 'disqus-comment-system/disqus.php' ))
{
$plugin_messages[] = 'This theme requires you to install the Disqus comment system plugin, <a href="http://wordpress.org/extend/plugins/disqus-comment-system/">download it from here</a>.';
}
// Download the WordPress popular posts plugin
if(!is_plugin_active( 'wordpress-popular-posts/wordpress-popular-posts.php' ))
{
$plugin_messages[] = 'This theme requires you to install the WordPress Popular Post plugin, <a href="http://wordpress.org/extend/plugins/wordpress-popular-posts/">download it from here</a>.';
}
if(count($plugin_messages) > 0)
{
echo '
<div id="message" class="error">';
foreach($plugin_messages as $message)
{
echo '
<strong>'.$message.'</strong>
';
}
echo '</div>
';
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment