可以添加选项和更改的示例代码。。。检查是否安装了插件。//初始挂钩的附加检查。
add_action(\'admin_init\', \'wpse_73859_init\');
function wpse_73859_init(){
// if - we in wp-admin
// if - we class of polylang not found
// and if we can manage_options (there a lot of different
// capabilities you can use install_plugins for example...)
if (!class_exists(\'Polylang\') && current_user_can(\'manage_options\')){
// message function created on a fly...
$msg = create_function(\'\', \'echo "<div class=\\"updated\\"><p>require polylang plugin</p></div>";\');
// and finaly notice!
add_action(\'admin_notices\', $msg);
}
}
实际上,你可以安装插件(无声下载/解压/激活),但它是如此未被接受,以至于你无法想象。你基本上破坏了使用你主题的人的隐私。