xmlrpc_getposttitle()WP 0.71

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.

Хуков нет.

Возвращает

Строку. Post title

Использование

xmlrpc_getposttitle( $content );
$content(строка) (обязательный)
XMLRPC XML Request content

Заметки

  • Global. Строка. $post_default_title Default XML-RPC post title.

Список изменений

С версии 0.71 Введена.

Код xmlrpc_getposttitle() WP 6.4.3

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