[Plugin: JSON API] set_thumbnail_value bug and fixed
-
I had to hack the code because the function could not populate the thumbnail post property if the image was present in my media files BUT was not attached to the current post
if (function_exists('get_post_thumbnail_id')) { $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail'); $this->thumbnail = $img[0]; } else { $attachments = $json_api->introspector->get_attachments($this->id); foreach ($attachments as $attachment) { if ($attachment->id == $values[0]) { $image = $attachment->images['thumbnail']; $this->thumbnail = $image->url; break; } } }
Hope it may help other people
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: JSON API] set_thumbnail_value bug and fixed’ is closed to new replies.