sal/class.json-api-post-base.php 1 location
|
@@ 259-267 (lines=9) @@
|
| 256 |
|
|
| 257 |
|
$thumb_id = get_post_thumbnail_id( $this->post->ID ); |
| 258 |
|
|
| 259 |
|
if ( ! empty( $thumb_id ) ) { |
| 260 |
|
$attachment = get_post( $thumb_id ); |
| 261 |
|
if ( ! empty( $attachment ) ) |
| 262 |
|
$featured_image_object = $this->get_attachment( $attachment ); |
| 263 |
|
|
| 264 |
|
if ( ! empty( $featured_image_object ) ) { |
| 265 |
|
$thumb = (object) $featured_image_object; |
| 266 |
|
} |
| 267 |
|
} |
| 268 |
|
|
| 269 |
|
return $thumb; |
| 270 |
|
} |
json-endpoints/class.wpcom-json-api-post-endpoint.php 1 location
|
@@ 317-325 (lines=9) @@
|
| 314 |
|
$response[$key] = null; |
| 315 |
|
|
| 316 |
|
$thumb_id = get_post_thumbnail_id( $post->ID ); |
| 317 |
|
if ( ! empty( $thumb_id ) ) { |
| 318 |
|
$attachment = get_post( $thumb_id ); |
| 319 |
|
if ( ! empty( $attachment ) ) |
| 320 |
|
$featured_image_object = $this->get_attachment( $attachment ); |
| 321 |
|
|
| 322 |
|
if ( ! empty( $featured_image_object ) ) { |
| 323 |
|
$response[$key] = (object) $featured_image_object; |
| 324 |
|
} |
| 325 |
|
} |
| 326 |
|
break; |
| 327 |
|
case 'format' : |
| 328 |
|
$response[$key] = (string) get_post_format( $post->ID ); |