You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @zenliver thanks for the issue. I think this could be a great idea. I might not be able to get to it for a little bit but I'll definitely take a look into how we could accomplish it. Feel free to make a PR if you have any ideas. I know that something like this might be coming to the official Rest API soon (https://core.trac.wordpress.org/ticket/43874)
The json fields filtering of official API has been already resolved by an excellent plugin WP REST API - filter fields, but the official API still has something not good.
Thank you for creating such an excellent wordpress REST API plugin, it enhances the output of JSON.This feature helps me a lot:
the official API:
/wp-json/wp/v2/posts?categories=5
this outputs only category 5's posts not including its children categories posts
and better-rest-endpoints API:
/wp-json/better-rest-endpoints/v1/posts?category=5
this outputs all posts of category 5 including all its children categories posts
appreciate for your excellent works!
Now I have a little suggestion about filtering the output of JSON.
Can we add a filter parameter to the API's endpoints to filter the output of JSON? For example:
if wen can use:
/wp-json/better-rest-endpoints/v1/posts?category=5&fields=id,title,date
(query string
&fields=id,title,date
is added)to output only the
id
title
date
fields, thus the JSON output will be much smaller.Many thanks! Wish you a happy life!
The text was updated successfully, but these errors were encountered: