xmlrpc_getposttitle()
Retrieves post title from XML-RPC XML.
If the title element is not found in the XML, the default post title from the $post_default_title global will be used instead.
No Hooks.
Returns
String. Post title.
Usage
xmlrpc_getposttitle( $content );
- $content(string) (required)
- XML-RPC XML Request content.
Notes
- Global. String.
$post_default_titleDefault XML-RPC post title.
Changelog
| Since 0.71 | Introduced. |
xmlrpc_getposttitle() xmlrpc getposttitle code WP 7.0
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;
}