you can test an error like that
$post_id = wp_insert_post($post_data, TRUE);
if (is_wp_error($post_id)) {
// there is an error
}
wp_redirect(site_url('/compledted/'));
exit();
you can test an error like that
$post_id = wp_insert_post($post_data, TRUE);
if (is_wp_error($post_id)) {
// there is an error
}
wp_redirect(site_url('/compledted/'));
exit();