wpseek.com
WordPress开发者和主题制作者的搜索引擎
xmlrpc_getpostcategory › WordPress Function
Since0.71
已弃用n/a
› xmlrpc_getpostcategory ( $content )
参数: |
|
返回: |
|
定义在: |
|
文档: |
Retrieves the post category or categories from XMLRPC XML.
If the category element is not found, then the default post category will be used. The return type then would be what $post_default_category. If the category is found, then it will always be an array.Related Functions: xmlrpc_getposttitle, wp_get_post_categories, wp_set_post_categories, xmlrpc_removepostdata, get_category
源码
function xmlrpc_getpostcategory( $content ) { global $post_default_category; if ( preg_match( '/<category>(.+?)<\/category>/is', $content, $matchcat ) ) { $post_category = trim( $matchcat[1], ',' ); $post_category = explode( ',', $post_category ); } else { $post_category = $post_default_category; } return $post_category; }