wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



xmlrpc_getposttitle › WordPress Function

Depuis0.71
Dépréciéen/a
xmlrpc_getposttitle ( $content )
Paramètres:
  • (string) $content XMLRPC XML Request content
    Requis: Oui
Retourne:
  • (string) Post title
Défini(e) dans:
Codex:

Retrieves 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.


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