Releases: factor1/better-rest-endpoints
Add Parent Slugs to Pages and Page By ID Endpoints
Adds the parent slug if it exists, returns false if not.
Add category_name param to posts endpoint
Adds the category_name
param to the posts endpoint to query posts by category slug (name).
Default Author Param Hotfix
Switches the default author
param for the posts endpoint to be an empty string instead of null
as null
was interpreted as a string.
Add `author` parameter to `posts` endpoint
Adds the author
parameter to the /posts
endpoint.
- author (string) limit posts by author nice name (user_nicename)
Add `user_nicename` to post responses
Adds user_nicename
to all post responses. Useful for doing queries of posts by author.
Add Exclude Parameter for Posts
Adds the exclude
parameter for posts endpoint.
Add Parameters to Post Endpoint
Adds order
and orderby
parameters for posts.
- orderby (string)
- order (string - 'ASC' vs 'DESC')
Add Search Endpoint
Search
better-wp-endpoints/v1/search
Gets a collection of posts and pages based on the search parameter. Accepts the following parameters:
- page (int)
- per_page (int)
- category id (int)
- tag id (int)
- content (boolean) set to false to omit content from showing in JSON response
- search (string | required)
It returns a JSON response with the following (returns an empty array if no posts found):
- id
- slug
- title
- date (ISO 8601)
- excerpt
- content
- all possible thumbnail sizes & URL
- Author & Author ID
- Categories
- Category IDs
- Tags
- Tag IDs
- ACF fields, if applicable
Fix CPT By Slug Endpoint
Fixes the get_cpt_by_slug
endpoint to actually pull the correct slug using the name
argument in WP_Query
.
Add parameter callbacks to custom tax cpts
0.1.14 Merge branch 'hotfix/tax-args'