xmlrpc_getposttitle()
Retrieves post title from XML-RPC XML.
If the title element is not found in the XML, the default post title from the $post_default_title global will be used instead.
Хуков нет.
Возвращает
string. Post title.
Использование
xmlrpc_getposttitle( $content );
- $content(строка) (обязательный)
- XML-RPC XML Request content.
Заметки
Global. Строка. $post_default_title Default XML-RPC post title. |
Список изменений
| С версии 0.71 | Введена. |
Код xmlrpc_getposttitle() xmlrpc getposttitle WP 7.1.5
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;
}