xmlrpc_getpostcategory( string $content )

Retrieve the post category or categories from XMLRPC XML.


Description Description

If the category element is not found, then the default post category will be used. The return type then would be what $post_default_category. If the category is found, then it will always be an array.


Parameters Parameters

$content

(string) (Required) XMLRPC XML Request content


Top ↑

Return Return

(string|array) List of categories or category name.


Top ↑

Source Source

File: wp-includes/functions.php

function xmlrpc_getpostcategory( $content ) {
	global $post_default_category;
	if ( preg_match( '/<category>(.+?)<\/category>/is', $content, $matchcat ) ) {
		$post_category = trim( $matchcat[1], ',' );
		$post_category = explode( ',', $post_category );
	} else {
		$post_category = $post_default_category;
	}
	return $post_category;
}

Top ↑

Changelog Changelog

Changelog
Version Description
0.71 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.