in_array() 관련 에러 발생 문의

안녕하세요 관리자님!

 

평안한 주말 보내셨는지요? 다름 아니라 홈페이지에 아래와 같은 에러가 발생하여 혹시나 어떻게 해결할 수 있을지 문의 드립니다.

 

Warning: in_array() expects parameter 2 to be array, string given in C:\Users\young\Local Sites\devserver\app\public\wp-content\themes\porto-child\functions.php on line 278

 

in_array()가 사용되는 곳의 코드는 아래와 같습니다. if 절이 278행 입니다. 신기한 점은 에러를 발생시키는데 해당 코드가 정상 작동(?)하고 있다는 점이 신기합니다.

 

해당 에러가 계속 에러로그에 쌓여서 에러가 안 떳으면 하는데 어떤식으로 해결하면 좋을까요?

 

//Monthly Hot Topic
add_filter('kboard_list_where', 'month_best_kboard_list_where', 10, 3);
function month_best_kboard_list_where($where, $board_id, $content_list){
	
	if($board_id == '16' || in_array('16', $board_id)){ // 실제 적용될 게시판의 ID값으로 변경해주세요.
		$today = date('Ymd000000', current_time( 'timestamp'));
		$date = date('Ymd000000', strtotime("{$today} - 1 month " )); // 이번달 시작 날짜 기준
		
		$where = "`date`>='{$date}' AND `board_id`!='12' AND `board_id`!='9' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
	}
	
	return $where;
}

 

항상 친절한 답변 주는 점 감사 드립니다.

 

 

워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
워드프레스 에러 기술지원 서비스 전문가에게 맡기세요