Created
November 19, 2009 17:07
-
-
Save mustardamus/238903 to your computer and use it in GitHub Desktop.
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
include "requiredplugins.php"; | |
add_action("wp_head", "includePluginCss"); | |
add_action("wp_footer", "outputPluginOverlay"); | |
function includePluginCss() { | |
global $plugins; | |
foreach($plugins as $plugin) { | |
if(!function_exists($plugin["function"])) { | |
echo '<link rel="stylesheet" type="text/css" media="screen" href="'.get_bloginfo('template_url').'/css/requiredplugins.css" />'; | |
break; | |
} | |
} | |
} | |
function outputPluginOverlay() { | |
global $plugins; | |
$requiredplugins = ""; | |
foreach($plugins as $plugin) { | |
if(!function_exists($plugin["function"])) { | |
$requiredplugins .= '<li><a href="'.get_bloginfo('home').'/wp-admin/plugin-install.php?tab=plugin-information&plugin='.$plugin["plugin"].'">Install</a> '.$plugin["name"].'</li>'; | |
} | |
} | |
if($requiredplugins != "") { | |
$requiredplugins = '<div id="requiredplugins-overlay"></div><div id="requiredplugins-list">Howdy! You are almost done enjoying your new theme, please install and activate the following plugins:<span>*refresh this page after you installed a plugin to see if it disappears from the list</span><ul>'.$requiredplugins.'</ul></div>'; | |
} | |
echo $requiredplugins; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment