📜  wordpress 设置类别前端 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:37.880000             🧑  作者: Mango

代码示例1
$postCats = trim( $_POST['post-cats']; )
$postCats = explode( ',', $postCats );

wp_set_object_terms( $post_id, array( $postCats[0], $postCats[1], $postCats[2], $postCats[3], $postCats[4] ), 'category' );