专注云服务商活动
网站运营运维笔记

安装WPJAM BASIC插件提示if($unread_count = $wpjam_topic_messages[‘unread_count’])报错

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;
}

将上面的所有代码注释掉或删除掉即可。

投上你的一票
域名主机商优惠信息推送QQ群: 627775477 获取商家优惠推送,禁言。
赞(0)
未经允许不得转载:老左笔记 » 安装WPJAM BASIC插件提示if($unread_count = $wpjam_topic_messages[‘unread_count’])报错