WordPress开发者和主题制作者的搜索引擎



xmlrpc_getposttitle ›

Since0.71
已弃用n/a
xmlrpc_getposttitle ( $content )
参数:
  • (string) $content XMLRPC XML Request content
    Required: Yes
返回:
  • (string) Post title
定义在:
文档:

Retrieve post title from XMLRPC XML.

If the title element is not part of the XML, then the default post title from the $post_default_title will be used instead.



源码

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;
}