wp_redirect($post->guid)
is not working. How can I fix this?
This is my code:
if(isset($_REQUEST['vid']) ){
$id=$_REQUEST['vid'];
$post_title = 'sasa';
$post_content ='zxczxczxc';
$new_post = array(
'ID' => '',
'post_author' => $user->ID,
'post_content' => $post_content,
'post_title' => $post_title,
'post_status' => 'publish',
// NOW IT'S ALREADY AN ARRAY
);
$post_id = wp_insert_post($new_post);
// This will redirect you to the newly created post
$post = get_post($post_id);
$url=$post->guid;
wp_redirect($post->guid);
}