Closed ghost closed 10 years ago
Opted for another solution that does the same job due to lack documentation and response from community.
I know its a little late for this, but for anyone in the future needing help:
excluded_posts = '';
for (var i=0; i < array_of_ids.length; i++)
{
excluded_posts += '&post__not_in[]=' + array_of_ids[i];
}
var url = 'www.example.com/api/get_posts/post_type=custom_post_type&count=6&offset=0' + excluded_posts;
note: array_of_ids is an array of ids you want to exclude.
Hej!
I can't get
post__not_in
parameter work when I fetch a bunch of posts. When use the following to fetch postswww.example.com/api/get_posts/?post_type=custom_post_type&post__not_in=array(1,2,3,4,6)&count=6&offset=0
, everything works fine but the posts with the ids1,2,3,4,5
are not excluded in the response.What am I doing wrong here?