从XMLRPC XML中检索帖子标题。
原型
xmlrpc_getposttitle( string $content )
描述
如果title元素不是XML的一部分,则将使用$ post_default_title中的默认帖子标题。
参数
$content
(string)
(Required)
XMLRPC XML请求内容
返回值
(string)
帖子标题
源文件
路径:wp-includes/functions.php
<?php
...
function xmlrpc_getposttitle( $content ) {
global $post_default_title;
if ( preg_match( '/<title>(.+?)</title>/is', $content, $matchtitle ) ) {
$post_title = $matchtitle[1];
} else {
$post_title = $post_default_title;
}
return $post_title;
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/xmlrpc_getposttitle/