리스트페이지 total 가져오기....

게시판 리스트 페이지에서

total에 대해 list.php에

<?php echo number_format($board->getListTotal())?>되어 있습니다.

조건을 변경해서 리스트페이지를 구현하고 싶은데...

getListTotal()에서는  return intval($this->meta->list_total); 게 받아오네요...

중간에 들어가 있는 if문은 조건해당이 안되어서 pass하고 getListTotal()에 바로 return되는 값을 찍어보니 이미 id값이 들어가 있는데요.

echo $this->meta->list_total;

이값을 어디에서 셋팅해 주는 건가요?

    public function getListTotal(){
        global $wpdb;
        if(!$this->id){
            return 0;
        }
        if(!$this->meta->list_total || $this->meta->list_total<=0){
            $this->meta->list_total = $this->getTotal();
            
            $results = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}kboard_board_content` WHERE `board_id`='$this->id' AND `status`='trash'");
            foreach($results as $row){
                $content = new KBContent();
                $content->initWithRow($row);
                $content->board = $this;
                $content->moveReplyToTrash($content->uid);
            }
        }
        return intval($this->meta->list_total);
    }

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