wp_redirect($post->guid)
不工作。我怎样才能解决这个问题?
这是我的代码:
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);
}