Not able to get featured image when post created through wordpress Rest API

50 Views Asked by At

Creating post through wordpress rest api and to set featured image I passed featured media as parameter and post is created and thumbnail id is set in database but get_post_meta doesn't return thumbnail id get_post_meta($post_id,'_thumbnail_id');

returning empty .

Can anyone help

Tried get_the_post_thumbnail_url($post_id, 'thumbnail') to get featured image but no result and $image_id = get_post_meta($post_id,'_thumbnail_id'); wp_get_attachment_url($image_id) but no results.Can anyone help what other possible solutions I can try

0

There are 0 best solutions below