json-endpoints/class.wpcom-json-api-post-endpoint.php 1 location
|
@@ 494-503 (lines=10) @@
|
| 491 |
|
return $return; |
| 492 |
|
} |
| 493 |
|
|
| 494 |
|
function get_blog_post( $blog_id, $post_id, $context = 'display' ) { |
| 495 |
|
$blog_id = $this->api->get_blog_id( $blog_id ); |
| 496 |
|
if ( !$blog_id || is_wp_error( $blog_id ) ) { |
| 497 |
|
return $blog_id; |
| 498 |
|
} |
| 499 |
|
switch_to_blog( $blog_id ); |
| 500 |
|
$post = $this->get_post_by( 'ID', $post_id, $context ); |
| 501 |
|
restore_current_blog(); |
| 502 |
|
return $post; |
| 503 |
|
} |
| 504 |
|
|
| 505 |
|
/** |
| 506 |
|
* Supporting featured media in post endpoints. Currently on for wpcom blogs |
json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php 1 location
|
@@ 284-293 (lines=10) @@
|
| 281 |
|
} |
| 282 |
|
|
| 283 |
|
// TODO: factor this out |
| 284 |
|
function get_blog_post( $blog_id, $post_id, $context = 'display' ) { |
| 285 |
|
$blog_id = $this->api->get_blog_id( $blog_id ); |
| 286 |
|
if ( !$blog_id || is_wp_error( $blog_id ) ) { |
| 287 |
|
return $blog_id; |
| 288 |
|
} |
| 289 |
|
switch_to_blog( $blog_id ); |
| 290 |
|
$post = $this->get_post_by( 'ID', $post_id, $context ); |
| 291 |
|
restore_current_blog(); |
| 292 |
|
return $post; |
| 293 |
|
} |
| 294 |
|
|
| 295 |
|
function win8_gallery_shortcode( $attr ) { |
| 296 |
|
global $post; |