$attach = $_POST['postdata'][0]['attach']; $duptitle = $_POST['postdata'][0]['duptitle']; $dupcontent = $_POST['postdata'][0]['dupcontent']; $type = $_POST['postdata'][0]['type']; $get_file = trim($get_file); $attach = trim($attach); $all_arr = $skinnyObj->get_xml_details($get_file); for ($j = 1; $j <= $authcnt; $j++) { $user_id = $skinnyObj->processAuthor($all_arr, $j, $type, $ex_user); foreach ($skinnyObj->detailedLog as $logKey => $logVal) { echo " </p>" . $logVal['verify_here'] . "</p>"; unset($skinnyObj->detailedLog[$logKey]); } } $user_id = $skinnyObj->get_user_id; $res = $skinnyObj->processDataInWP($all_arr, $implimit, $user_id, $attach, $duptitle, $dupcontent, $type); foreach ($skinnyObj->detailedLog as $logKey => $logVal) { print_r("</p>" . $logVal['verify_here'] . "</p>"); } $total = $total - 1; if ($implimit == $total) { foreach ($_SESSION['post_id'] as $key => $value) { $post_id = explode('|', $value); if (is_array($_SESSION['attach_id'])) { foreach ($_SESSION['attach_id'] as $akey => $aval) { $attach_id = explode('|', $aval); if ($attach_id[1] == $post_id[1]) { global $wpdb; $file_name = $wpdb->get_results("select guid from " . $wpdb->posts . " where ID = {$attach_id[0]} "); $update = $wpdb->get_results("update {$wpdb->posts} set post_parent = {$post_id[0]} where ID = {$attach_id[0]}"); set_post_thumbnail($post_id[0], $attach_id[0]);