Category: WordPress REST API
How to see the SQL Queries being executed in WordPress REST API
You can add the following filter and you will see the queries in the Response Header.
Custom Post Type returning only posts belonging to the Author in WordPress REST API
Add the following to your plugin code. Replace ‘goals’ with your content type name. About this solution. The great part about this is that you don’t need to create any custom endpoints to show only the related posts to the author. Can apply very easily for any CUSTOM Posts. Possible Scenarios where can you use…
Enabling Filters for Meta Fields in the WordPress Rest API.
WordPress has been an excellent platform and as of now it is gaining popularity as a headless CMS. And I too have chosen to keep WordPress as a headless CMS. And why not WordPress has lots of great features and a very active development community. I mean no software is perfect and the best next…
WordPress REST API. Sorting/Orderby for custom meta fields in WordPress and fixing “Invalid parameter(s): orderby”
Why? By default in WordPress you can only use the valid fields which are specified by each post type. Read more on WordPresss REST API documentation. This post is useful to you if you might be receiving an error as following. code “rest_invalid_param” message “Invalid parameter(s): orderby” How can you check which fields are available…