设置帖子ID所属的类别。
原型
wp_set_post_cats( int $blogid = '1', int $post_ID, array $post_categories = array() )
参数
$blogid
(int)
(Optional)
不曾用过
$post_ID
(int)
(Required)
$post_categories
(array)
(Optional)
返回值
(bool|mixed)
源文件
路径:wp-includes/deprecated.php
<?php
...
function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) {
_deprecated_function( __FUNCTION__, '2.1.0', 'wp_set_post_categories()' );
return wp_set_post_categories($post_ID, $post_categories);
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wp_set_post_cats/