json-endpoints/class.wpcom-json-api-post-endpoint.php 1 location
|
@@ 426-430 (lines=5) @@
|
423 |
|
case 'categories': |
424 |
|
$response[$key] = array(); |
425 |
|
$terms = wp_get_object_terms( $post->ID, 'category', array( 'fields' => 'all' ) ); |
426 |
|
foreach ( $terms as $term ) { |
427 |
|
if ( !empty( $term->name ) ) { |
428 |
|
$response[$key][$term->name] = $this->format_taxonomy( $term, 'category', 'display' ); |
429 |
|
} |
430 |
|
} |
431 |
|
$response[$key] = (object) $response[$key]; |
432 |
|
break; |
433 |
|
case 'attachments': |
sal/class.json-api-post-base.php 1 location
|
@@ 104-108 (lines=5) @@
|
101 |
|
public function get_categories() { |
102 |
|
$categories = array(); |
103 |
|
$terms = wp_get_object_terms( $this->post->ID, 'category', array( 'fields' => 'all' ) ); |
104 |
|
foreach ( $terms as $term ) { |
105 |
|
if ( !empty( $term->name ) ) { |
106 |
|
$categories[$term->name] = $this->format_taxonomy( $term, 'category', 'display' ); |
107 |
|
} |
108 |
|
} |
109 |
|
return (object) $categories; |
110 |
|
} |
111 |
|
|