wp_set_post_cats

函式
wp_set_post_cats ( $blogid = '1', $post_ID = 0, $post_categories = array() )
引數
  • (int) $blogid Not used
    Required:
    Default: '1'
  • (int) $post_ID
    Required:
  • (array) $post_categories
    Required:
    Default: array()
返回值
  • (bool|mixed)
相關
  • wp_set_post_categories()
定義位置
相關方法
wp_get_post_catswp_set_post_tagswp_set_post_termswp_set_post_categorieswp_set_post_lock
引入
1.0.1
棄用
2.1.0

wp_set_post_cats是一個WordPress函式,用於設定給定文章的類別

設定文章ID所屬的類別。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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);
}
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); }
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);
}

常見問題

FAQs
檢視更多 >