• Resolved stagezero

    (@stagezero)


    Im accessing CPT using rest.
    My problem is that REST API only shows
    featured_media: ‘ID’
    and
    0._links.wp:featuredmedia[0].href: as another REST API link.

    The issue is that if you have to query lots of posts, its very slow as you need to loop to each Featured Image REST API to access data.

    Is there a chance we can add a thumbnail image link rather than ID in REST?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    From what I’ve managed to see and google, if you add _embed to you endpoint, it’ll include media information.

    For example, I have a site with a bunch of books in a post type, and this URL brings in the book info as well as all the various featured image sizes AND image paths:

    /wp-json/wp/v2/books?_embed
    

    Worth a try on your end.

Viewing 1 replies (of 1 total)
  • The topic ‘Missing Featured Image URL in REST API’ is closed to new replies.