Access WP custom REST Fields in custom route

I have created custom fields to display in WordPress rest api. I want the same data to be fetched into a custom route api. How it is possible?

That is, I have some custom rest fields in the path example.com/wp-json/wp/v2/posts/

have the following rest fields I need to show in the another route. ie at example.com/wp-json/mycustom/route/v2

How can I do it?

Read more here: Access WP custom REST Fields in custom route

Leave a Reply

Your email address will not be published. Required fields are marked *