Open JoryHogeveen opened 8 months ago
Introduction of the query_fields
function in PodsRESTFields
class
This modification brings in a new function called query_fields
. This function comes in handy in refining the parameters for a REST request depending on the field values given. In simpler terms, it curtails through unnecessary data in a request, helping the program to process only the specific, relevant pieces of information.
Inclusion of a filter hook named rest_{pod_name}_query
Another function called rest_{pod_name}_query
has been introduced, which allows us to apply the above query_fields
function to a specific category (or 'pod' in programming language). Essentially, it provides a way for integrating the filtering feature with specific parts of our system.
Description
This PR will add basic support for meta based REST API queries when passing Pods fields as parameters.
Related GitHub issue(s)
Fixes #7210
Testing instructions
example.com/wp-json/wp/v2/{CPT}?{FIELDNAME}={VALUE}
Changelog text for these changes
PR checklist