xmlrpc_getposttitle

Retrieve post title from XMLRPC XML.

Description

(string) xmlrpc_getposttitle( (string) $content ); 

If the title element is not part of the XML, then the default post title from the $post_default_title will be used instead.

Returns (string)

Post title

Parameters (1)

0. $content (string)
XMLRPC XML Request content

Usage

  1. if ( !function_exists( 'xmlrpc_getposttitle' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4. // XMLRPC XML Request content 
  5. $content = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = xmlrpc_getposttitle($content); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.php  
  1. function xmlrpc_getposttitle( $content ) { 
  2. global $post_default_title; 
  3. if ( preg_match( '/<title>(.+?)<\/title>/is', $content, $matchtitle ) ) { 
  4. $post_title = $matchtitle[1]; 
  5. } else { 
  6. $post_title = $post_default_title; 
  7. return $post_title;