Quantcast
Channel: WordPress.org Forums » [WordPress REST API (Version 2)] Support
Viewing all articles
Browse latest Browse all 30

how to filter featured_media key / specific meta_value in query string?

$
0
0

Replies: 0

hi.. i have a problem to get all the posts that only have the featured image.
i think there’re 2 possible ways but i don’t know how to do it.

1. the featured_media value for all the posts that don’t have image is 0. i try this /wp-json/wp/v2/posts?featured_media=0 or /wp-json/wp/v2/posts?filter[featured_media]=0, it didn’t work.

2. there’s a meta key called ‘_thumbnail_id’. so for the post that doesn’t use the image will be an empty string. i use this /wp-json/wp/v2/posts?filter[meta_key]=_thumbnail_id but i don’t know how to filter the meta_value to return not empty.

any help ?
thanks


Viewing all articles
Browse latest Browse all 30

Trending Articles