xmlrpc_getposttitle() WordPress Function
The xmlrpc_getposttitle() function is used to get the post title of a given post. This function is only available for WordPress versions 2.6 and above.
xmlrpc_getposttitle( string $content ) #
Retrieve post title from XMLRPC XML.
Description
If the title element is not part of the XML, then the default post title from the $post_default_title will be used instead.
Parameters
- $content
(string)(Required)XMLRPC XML Request content
Return
(string) Post title
Source
File: wp-includes/functions.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;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 0.71 | Introduced. |