WPCOM_JSON_API_Taxonomy_Endpoint

The Jetpack by WordPress.com WPCOM JSON API Taxonomy Endpoint class.

Defined (1)

The class is defined in the following location(s).

/json-endpoints/class.wpcom-json-api-taxonomy-endpoint.php  
  1. abstract class WPCOM_JSON_API_Taxonomy_Endpoint extends WPCOM_JSON_API_Endpoint { 
  2. public $category_object_format = array( 
  3. 'ID' => '(int) The category ID.',  
  4. 'name' => "(string) The name of the category.",  
  5. 'slug' => "(string) The slug of the category.",  
  6. 'description' => '(string) The description of the category.',  
  7. 'post_count' => "(int) The number of posts using this category.",  
  8. 'parent' => "(int) The parent ID for the category.",  
  9. 'meta' => '(object) Meta data',  
  10. ); 
  11.  
  12. public $tag_object_format = array( 
  13. 'ID' => '(int) The tag ID.',  
  14. 'name' => "(string) The name of the tag.",  
  15. 'slug' => "(string) The slug of the tag.",  
  16. 'description' => '(string) The description of the tag.',  
  17. 'post_count' => "(int) The number of posts using this t.",  
  18. 'meta' => '(object) Meta data',  
  19. ); 
  20.  
  21. function __construct( $args ) { 
  22. parent::__construct( $args ); 
  23. if ( preg_match( '#/tags/#i', $this->path ) ) 
  24. $this->response_format =& $this->tag_object_format; 
  25. else 
  26. $this->response_format =& $this->category_object_format;