xmlrpc_getpostcategory()
xmlrpc_getpostcategory( string $content ) 从xmlrpcxml检索文…
xmlrpc_getpostcategory( string $content )
从xmlrpcxml检索文章类别。
Retrieve the post category or categories from XMLRPC XML.
目录锚点:#说明#参数#源码
说明(Description)
如果找不到category元素,那么将使用默认的post category。返回类型将是$post_default_类别。如果找到了类别,那么它将始终是一个数组。
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $content | (string) | XMLRPC XML请求内容 |
源码(Source)
/**
* Retrieve 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.
*
* @since 0.71
*
* @global string $post_default_category Default XML-RPC post category.
*
* @param string $content XMLRPC XML Request content
* @return string|array List of categories or category name.
*/
function xmlrpc_getpostcategory( $content ) {
global $post_default_category;
if ( preg_match( '/(.+?)< ategory="">/is', $content, $matchcat ) ) {
$post_category = trim( $matchcat[1], ',' );
$post_category = explode( ',', $post_category );
} else {
$post_category = $post_default_category;
}
return $post_category;
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 0.71 | wp-includes/functions.php | 9 | 9 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
还没有任何评论,赶紧来占个楼吧!