xmlrpc_getposttitle( string $content ): string

Retrieves 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

$contentstringrequired
XMLRPC XML Request content

Return

string Post title

Source

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

Changelog

VersionDescription
0.71Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.