WPJAM BASIC 插件算是比较知名的WordPress优化插件之一。这里在有安装的时候有报错if($unread_count = $wpjam_topic_messages[‘unread_count’])。
通过插件的问题目标,找到路径所描述的插件”wpjam-basic/include/topic.php“文件,可以插件找到如下代码(大概在第83行到112行):
add_filter('wpjam_pages', 'wpjam_topic_admin_pages');
add_filter('wpjam_network_pages', 'wpjam_topic_admin_pages');
function wpjam_topic_admin_pages($wpjam_pages){
$subs = array();
$menu_title = 'WP问题';
if(wpjam_topic_get_weixin_user()){
$wpjam_topic_messages = wpjam_get_topic_messages();
if($unread_count = $wpjam_topic_messages['unread_count']){
$menu_title .= '<span class="update-plugins count-'.$unread_count.'"><span class="plugin-count">'.$unread_count.'</span></span>';
}
$subs['wpjam-topics'] = array('menu_title'=> '所有问答', 'function'=>'wpjam_topics_page', 'capability' => 'read');
$subs['wpjam-topic'] = array('menu_title'=> '我要提问', 'function'=>'wpjam_topic_edit_page','capability' => 'read');
$subs['wpjam-topic-user'] = array('menu_title'=> '个人资料', 'function'=>'wpjam_topic_user_page','capability' => 'read');
if(isset($_GET['page']) && ($_GET['page'] == 'wpjam-topic-messages')){
$subs['wpjam-topic-messages'] = array('menu_title'=> '消息提醒', 'function'=>'wpjam_topic_messages_page','capability' => 'read');
}
}
$wpjam_pages['wpjam-topics'] = array(
'menu_title' => $menu_title,
'icon' => 'dashicons-wordpress',
'subs' => $subs,
'capability' => 'read'
);
return $wpjam_pages;
}
将上面的所有代码注释掉或删除掉即可。