$post = array(
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_author' => 2,
'post_content' => $_POST['synopsis'],
'post_name' => sanitize_title($_POST['title']),
'post_status' => 'private',
'post_title' => $_POST['title'],
'post_type' => 'film',
'tax_input' => array(
'film_category' => array(
$_POST['category']
)
)
);
$new_film_id = wp_insert_post($post);
2 个评论