| @@ 342-355 (lines=14) @@ | ||
| 339 | } |
|
| 340 | } |
|
| 341 | break; |
|
| 342 | case 'post_thumbnail' : |
|
| 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 ); |
|
| 358 | if ( !$response[$key] ) { |
|
| @@ 326-339 (lines=14) @@ | ||
| 323 | } |
|
| 324 | } |
|
| 325 | break; |
|
| 326 | case 'post_thumbnail' : |
|
| 327 | $response[$key] = null; |
|
| 328 | ||
| 329 | $thumb_id = get_post_thumbnail_id( $post->ID ); |
|
| 330 | if ( ! empty( $thumb_id ) ) { |
|
| 331 | $attachment = get_post( $thumb_id ); |
|
| 332 | if ( ! empty( $attachment ) ) |
|
| 333 | $featured_image_object = $this->get_attachment( $attachment ); |
|
| 334 | ||
| 335 | if ( ! empty( $featured_image_object ) ) { |
|
| 336 | $response[$key] = (object) $featured_image_object; |
|
| 337 | } |
|
| 338 | } |
|
| 339 | break; |
|
| 340 | case 'format' : |
|
| 341 | $response[$key] = (string) get_post_format( $post->ID ); |
|
| 342 | if ( !$response[$key] ) { |
|