Closed Marneus77 closed 5 years ago
so this is a wordpress.com issue, not with self-hosted wordpress sites?
The WordPress Rest API Docs have it as status
.
@Marneus77 to query posts by statuses you must use authorization. So try to change your code like:
var result = await client.Posts.Query(postsquerybuilder,true);
UPD: in WP API this fields named status so in our library it naming correctly. When you changed status to statuses WP couldn`t find it and so just ignores it :)
I checked a self-hosted WP site, it's the same: statuses
Thanks for the tip. But I then have to implement authentication? I don't have the jwt plugin installed on the blog, how do I authenticate?
Install JWT and configure it. Field name is status. You could check it in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php line 184 Statuses isn`t exist in WP REST API so it ignores it and returns default - publish posts.
When making a postquery with filter on status, an error comes: "invalid parameter: status" Querytext should be "statuses"
It's probably the same in others utility.querybuilder classes.
More than that, once fixed, I seem to be still only getting the default "publish". This problem seems to be coming from Wordpress.com because entering the url manually with &statuses=draft,pending returns published posts too