json-endpoints/class.wpcom-json-api-post-endpoint.php 1 location
|
@@ 346-354 (lines=9) @@
|
| 343 |
|
$response[$key] = null; |
| 344 |
|
|
| 345 |
|
$thumb_id = get_post_thumbnail_id( $post->ID ); |
| 346 |
|
if ( ! empty( $thumb_id ) ) { |
| 347 |
|
$attachment = get_post( $thumb_id ); |
| 348 |
|
if ( ! empty( $attachment ) ) |
| 349 |
|
$featured_image_object = $this->get_attachment( $attachment ); |
| 350 |
|
|
| 351 |
|
if ( ! empty( $featured_image_object ) ) { |
| 352 |
|
$response[$key] = (object) $featured_image_object; |
| 353 |
|
} |
| 354 |
|
} |
| 355 |
|
break; |
| 356 |
|
case 'format' : |
| 357 |
|
$response[$key] = (string) get_post_format( $post->ID ); |
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 |
|
} |