wp_xmlrpc_server::mw_getCategories( array $args ): array|IXR_Error

In this article

Retrieves the list of categories on a given blog.

Parameters

$argsarrayrequired
Method arguments. Note: arguments must be ordered as documented.
  • 0 int
    Blog ID (unused).
  • 1 string
    Username.
  • 2 string
    Password.

Return

array|IXR_Error

Source

$allow_pings    = ( 'open' === $entry['ping_status'] ) ? 1 : 0;

// Consider future posts as published.
if ( 'future' === $entry['post_status'] ) {
	$entry['post_status'] = 'publish';
}

// Get post format.
$post_format = get_post_format( $entry['ID'] );
if ( empty( $post_format ) ) {
	$post_format = 'standard';
}

$recent_posts[] = array(
	'dateCreated'            => $post_date,
	'userid'                 => $entry['post_author'],
	'postid'                 => (string) $entry['ID'],
	'description'            => $post['main'],
	'title'                  => $entry['post_title'],
	'link'                   => $link,
	'permaLink'              => $link,
	// Commented out because no other tool seems to use this.
	// 'content' => $entry['post_content'],
	'categories'             => $categories,
	'mt_excerpt'             => $entry['post_excerpt'],
	'mt_text_more'           => $post['extended'],
	'wp_more_text'           => $post['more_text'],
	'mt_allow_comments'      => $allow_comments,
	'mt_allow_pings'         => $allow_pings,
	'mt_keywords'            => $tagnames,
	'wp_slug'                => $entry['post_name'],
	'wp_password'            => $entry['post_password'],
	'wp_author_id'           => (string) $author->ID,
	'wp_author_display_name' => $author->display_name,
	'date_created_gmt'       => $post_date_gmt,
	'post_status'            => $entry['post_status'],
	'custom_fields'          => $this->get_custom_fields( $entry['ID'] ),
	'wp_post_format'         => $post_format,

Changelog

VersionDescription
1.5.0Introduced.

User Contributed Notes

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