/**

    *WordPress 提醒用户当前主题需要的插件

    *https://www.weixiaoduo.com/plugins-messages/

*/

functionBing_plugins_messages(){

    $plugin_messages=array();

    include_once(ABSPATH.'wp-admin/includes/plugin.php');

    //必须安装 WordPress SEO 插件

    if(!is_plugin_active('WordPress-seo/-seo.php'))$plugin_messages[]='当前主题要求必须安装并启用 WordPress SEO 插件,<a href="http://WordPress.org/plugins/WordPress-seo/" target="_blank"> 点击下载此插件</a>';

    //必须安装 Simple URLs 插件

    if(!is_plugin_active('simple-urls/plugin.php'))$plugin_messages[]='当前主题要求必须安装并启用 Simple URLs 插件,<a href="http://WordPress.org/plugins/simple-urls/" target="_blank"> 点击下载此插件</a>';

    //必须安装 Bing Phone 插件

    if(!is_plugin_active('Bing-Phone/Bing-Phone.php'))$plugin_messages[]='当前主题要求必须安装并启用 Bing-Phone 插件,<a href="http://www.bgbk.org/wp-theme-bing-phone.html" target="_blank"> 点击下载此插件</a>';

    if(count($plugin_messages)>0){

        echo'<div id="message" >';

            foreach($plugin_messagesas$message)echo'<p><strong>'.$message.'</strong></p>';

        echo'</div>';

    }

}

add_action('admin_notices','Bing_plugins_messages');