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
|
@@ 82-86 (lines=5) @@
|
| 79 |
|
public function get_categories() { |
| 80 |
|
$categories = array(); |
| 81 |
|
$terms = wp_get_object_terms( $this->post->ID, 'category', array( 'fields' => 'all' ) ); |
| 82 |
|
foreach ( $terms as $term ) { |
| 83 |
|
if ( !empty( $term->name ) ) { |
| 84 |
|
$categories[$term->name] = $this->format_taxonomy( $term, 'category', 'display' ); |
| 85 |
|
} |
| 86 |
|
} |
| 87 |
|
return (object) $categories; |
| 88 |
|
} |
| 89 |
|
|