$return_path = add_query_arg($return_args, get_the_permalink($post_id)); if (isset($_POST['g-recaptcha-response'])) { $cpt_response = sanitize_text_field($_POST['g-recaptcha-response']); $response = kingkongboard_captcha_initialize($board_id, $cpt_response); } else { $response = true; } if ($response == false) { $result['status'] = 'failed'; $result['message'] = __('자동글 방지에 체크하셔야 합니다.', 'kingkongboard'); } else { $Board = new kkbController(); if ($_POST['write_type'] == 'write' || $_POST['write_type'] == 'reply') { $entry_id = $Board->writeEntry($board_id, $_POST, 'basic'); if ($entry_id && is_numeric($entry_id)) { $upload = $Board->fileUploader($entry_id, $_POST, $_FILES); if ($upload) { if (is_array($upload)) { $message = $upload['message']; $result['status'] = 'failed'; $result['message'] = $message; } else { $result['status'] = 'success'; $result['url'] = get_the_permalink($post_id); } } else { $result['status'] = 'success'; $result['url'] = get_the_permalink($post_id); } } else { is_array($entry_id) ? $message = $entry_id['message'] : ($message = $entry_id);