我了解以下代码检查插件是否已安装,如果未安装,则会在WP后端出错:
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>.\';
}
if(count($plugin_messages) > 0)
{
echo \'<div id="message" class="error">\';
foreach($plugin_messages as $message)
{
echo \'<p><strong>\'.$message.\'</strong></p>\';
}
echo \'</div>\';
}
}
我的问题是:如何找到此行中使用的URL:
if(!is_plugin_active( \'disqus-comment-system/disqus.php\' ))
我正在尝试将此代码用于此代码段中未列出的其他插件,我不知道在哪里可以找到这些URL来检查插件是否被使用。任何帮助都将不胜感激。