작성자 게시글 리스트와 작성자 댓글 보기 질문

항상 고생하시는 제작자님 늘 감사드립니다.

 

KBoard 위젯을 활용하여 KBoard 게시글 본문 페이지에서 해당 작성자가 작성한 게시글과 댓글을 표시하고 싶습니다..!

add_filter('kboard_widget_tab_list', 'my_kboard_widget_tab_list', 10, 1);
function my_kboard_widget_tab_list($tab_list){
	$tab_list[] = '글쓴이 게시글';
  $tab_list[] = '글쓴이 댓글';

	return $tab_list;
}

add_filter('kboard_widget_list_where', 'my_kboard_widget_list_where', 10, 5);
function my_kboard_widget_list_where($where, $value, $limit, $exclude, $with_notice){
	global $wpdb;

	$content_uid = kboard_uid();

	if($value == '글쓴이 게시글'){
		if($content_uid){

			$content = new KBContent();
			$content->initWithUID($content_uid);
			$where .= " AND `member_uid`='{$content->member_uid}'";
		}
		else{
			$where = '0';
		}
	}

  $comment_uid = kboard_uid();

	if($value == '글쓴이 댓글'){
		if($comment_uid){

			$comment = new KBComment();
			$comment->initWithUID($comment_uid);
			$where .= " AND `member_uid`='{$content->member_uid}'";
		}
		else{
			$where = '0';
		}
	}

	return $where;
}

 

올려주신 코드를 참조하여 탭 두 개를 추가하고 리스트를 추출하는 데

올려주신 게시글 코드는 동작을 하는데 보고

따라해본 댓글 추출이 안되더라구요..

 

			$comment = new KBComment();
			$comment->initWithUID($comment_uid);
			$where .= " AND `member_uid`='{$content->member_uid}'"; //

 

나름 추가해본 이 부분이 뭔가 잘못된 거 같은데 어떻게 고쳐야 할까요..ㅜㅜ

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