KBcontent 클래스 첨부파일 문의

안녕하세요. 

먼저 케이보드 및 회원관리 플러그인 잘 사용중이며 감사 말씀 전해드립니다. 

 

특정 상황에서 케이보드 게시판에 자동 글쓰기 기능을 만들어보고 있는데 첨부파일 전달이 잘 안되어 질문 남겨드립니다. 

--- php ---

// add the action 
add_action( 'wpcf7_before_send_mail', 'action_wpcf7_before_send_mail', 10, 3 ); 

// define the wpcf7_before_send_mail callback 
function action_wpcf7_before_send_mail( $contact_form ) { 
    // make action magic happen here... 
    $data=array();
    //$add_option=array();
    $title = $contact_form->title;
    $submission = WPCF7_Submission::get_instance();

    if ( $submission ) {
        $posted_data = $submission->get_posted_data();
        $attach_file_url = implode($submission->uploaded_files());
        for($str_len_temp = strlen($attach_file_url);$str_len_temp>=0;$str_len_temp--) if($attach_file_url[$str_len_temp]=='/') break;
        $attach_file = substr($attach_file_url,$str_len_temp+1);
        $attach_file_url = str_replace($attach_file,'',$attach_file_url);
        //$attach_file_url = str_replace('/', DIRECTORY_SEPARATOR, attach_file_url);
    }
    
    if($title == '양식001'){
        $data['board_id'] = '1';
        $data['parent_uid'] = '';
        $data['member_uid'] = $posted_data['your_login'];
        $data['member_display'] = $posted_data['your_name'];
        $data['title'] = $posted_data['your_title'];
        $data['content'] = "| 내용 | \n\n";
        $data['date'] = date('YmdHis', current_time('timestamp'));
        $data['update'] = date('YmdHis', current_time('timestamp'));
        $data['view'] = 0;
        $data['comment'] = 0;
        $data['like'] = 0;
        $data['unlike'] = 0;
        $data['vote'] = 0;
        $data['category1'] = '';
        $data['category2'] = '읽지않음';
        $data['secret'] = '';
        $data['notice'] = '';
        $data['search'] = '1';
        $data['file_path'] = $attach_file_url;
        $data['file_name'] = $attach_file;
        //$data['thumbnail_file'] = $attach_file_url;
        //$data['thumbnail_name'] = $attach_file;
        $data['status'] = '';
            
        $content = new KBContent();
        //$content->setBoardID(1);

        $content->insertContent($data);
    }
}; 

--- php ---

전달 받은 컨택트폼 클래스에서 데이터 경로와 파일명을 얻는데까지는 성공했는데 

KBcontent 클래스인 $content에 전달이 잘 안되네요..

클래스 열어서 보긴했는데 PHP는 첨이라 잘 이해가 안되기도 해서 팁이 될만한게 있을까하여 문의글 남겨봅니다.

:)

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