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.


Top ↑

Parameters

$content

(string)(Required)XMLRPC XML Request content


Top ↑

Return

(string) Post title


Top ↑

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


Top ↑

Changelog

Changelog
VersionDescription
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More