Wednesday, November 2, 2022
HomeWordPress Developmentwp question - The way to replecate the _fields parameter in customized...

wp question – The way to replecate the _fields parameter in customized REST api endpoint


I’m making an attempt to herald further fields like I can within the wp/v2 namespace utilizing the posts endpoint. How do I replecate the _fields property to get the wp:phrases and whatnot for entry to the featured picture and all the stuff that does not instantly include get_posts / WP_Query? My pattern argument for the info I need is like this:

`https://instance.com/wp-json/instance/v1/posts_by_category?_fields=writer,id,excerpt,slug,title,hyperlink,_links,_embedded&_embed&_embedded.wp:time period[0].slug=${params.slug}`

I am simply unsure how one can add this performance in my customized operate.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments