当类别来自表单时,如何在wp\\u insert\\u post中使用?
$my_post = array();
$my_post[\'post_author\'] = $userid;
$my_post[\'post_title\'] = $name;
$my_post[\'post_name\'] = str_replace(\' \', \'-\', $name);
$my_post[\'post_category\'] = $selected = $_POST[\'postcats\'];
$newpost_id= wp_insert_post( $my_post );
是否正确?怎么了?非常感谢