Extend cpt api endpoint
-
Hi there,
i’ve added the endpoint products and product-categories with acf and activated it via the api-switch. Now i can get all my products with /wp-json/wp/v2/products?_fields=title – fine. My questions is, how i can extend this request, to get only products, where has product-category=slug/id (slug or id from product-categories).
My only idea is to do a pre request with a custom endpoint (eg. get_product_ids_by_category_slug) and after that the normal request like /wp-json/wp/v2/products?_fields=title&include=55,56 …
Any ideas?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Extend cpt api endpoint’ is closed to new replies.