Archived
Event API: Add thumbnails
This commit is contained in:
1 parent
4b5f8c4125
commit
b549bdcbc7
1 file changed
+7
@@ -146,6 +146,13 @@ function api_add_custom_fields($response, $post, $request) {
|
||||
$response->data['start_time'] = date("c", $response->data['start_time'] - $offset_in_seconds);
|
||||
$response->data['end_time'] = date("c", $response->data['end_time'] - $offset_in_seconds);
|
||||
|
||||
/* Add thumbnail in all sizes */
|
||||
$sizes = get_intermediate_image_sizes();
|
||||
$response->data['thumbnail'] = array();
|
||||
foreach ($sizes as $size) {
|
||||
$response->data['thumbnail'][$size] = get_the_post_thumbnail_url($post->ID, $size);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user