WordPress.org

Ready to get started?Download WordPress

Forums

XML-RPC : can't manage to get even empty categories using wp.getTerms (1 post)

  1. bdobox
    Member
    Posted 1 year ago #

    Hi,

    I'am using WP 3.5.1 and I simply try to get the list of all categories name, but using the XML-RPC API. It's like hide_empty is not use.

    $args = array (
    		'orderby'       => 'name',
    		'order'         => 'ASC',
    		'hide_empty'    => false	);
    
    // Get a list of categories
    if ( !$client->query( 'wp.getTerms', '', $username, $password, "category", $args ) ) {
    	die( 'An error occurred - ' . $client->getErrorCode() . ": " . $client->getErrorMessage() );
    }

    This code return me :

      no category when there is no post
      only caterogies associated with posts

    I surely miss something, but I can't find what. Maybe some one has the answer.

    Think in advance for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic