Skip to content

Commit d1408b1

Browse files
committed
Update versions, update changelogs, reorder params in readme to be alphabetical
1 parent e091b17 commit d1408b1

File tree

5 files changed

+118
-107
lines changed

5 files changed

+118
-107
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [Unreleased]
88
n/a
99

10+
## [1.3.0] - 2018-06-05
11+
### Added
12+
- Yoast SEO output, see docs for more information
13+
14+
### Updated
15+
- Slug output in responses
16+
1017
## [1.2.1] - 2018-06-04
1118
### Added
1219
- Permalinks to all page/post endpoints

README.md

+103-103
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,34 @@ A WordPress plugin that serves up slimmer WP Rest API endpoints.
77
**`better-rest-endpoints/v1/posts`**
88
Gets a collection of posts. Accepts the following parameters:
99

10-
- page (int)
11-
- per_page (int)
10+
- acf (boolean - setting to false omits `acf` from being returned)
11+
- author (string) limit posts by author nice name (user_nicename)
1212
- category id (int)
1313
- category_name (string)
14-
- tag id (int)
1514
- content (boolean) set to false to omit content from showing in JSON response
16-
- orderby (string)
17-
- order (string - 'ASC' vs 'DESC')
1815
- exclude (int) a post ID to exclude from the response
19-
- author (string) limit posts by author nice name (user_nicename)
20-
- acf (boolean - setting to false omits `acf` from being returned)
21-
- yoast (boolean - setting to false omits `yoast` from being returned)
2216
- media (boolean - setting to false omits `media` (featured media) from being returned)
17+
- order (string - 'ASC' vs 'DESC')
18+
- orderby (string)
19+
- page (int)
20+
- per_page (int)
21+
- tag id (int)
22+
- yoast (boolean - setting to false omits `yoast` from being returned)
2323

2424
It returns a JSON response with the following:
25-
- id
26-
- slug
27-
- title
28-
- date (ISO 8601)
29-
- excerpt
30-
- content
25+
- ACF fields, if applicable
3126
- all possible thumbnail sizes & URL
3227
- Author, user_nicename, & Author ID
3328
- Categories
3429
- Category IDs
35-
- Tags
30+
- content
31+
- date (ISO 8601)
32+
- excerpt
33+
- id
34+
- slug
3635
- Tag IDs
37-
- ACF fields, if applicable
36+
- Tags
37+
- title
3838
- Yoast SEO fields, if applicable
3939

4040
### Post
@@ -47,19 +47,19 @@ Accepts the following parameters:
4747

4848
Returns a JSON response with the following:
4949

50-
- id
51-
- slug
52-
- title
53-
- date (ISO 8601)
54-
- excerpt
55-
- content
50+
- ACF fields, if applicable
5651
- all possible thumbnail sizes & URLs
5752
- Author, user_nicename, & Author ID
5853
- Categories
5954
- Category IDs
60-
- Tags
55+
- content
56+
- date (ISO 8601)
57+
- excerpt
58+
- id
59+
- slug
6160
- Tag IDs
62-
- ACF fields, if applicable
61+
- Tags
62+
- title
6363
- Yoast SEO fields, if applicable
6464

6565
### Post by slug
@@ -72,46 +72,46 @@ Accepts the following parameters:
7272

7373
Returns a JSON response with the following:
7474

75-
- id
76-
- slug
77-
- title
78-
- date (ISO 8601)
79-
- excerpt
80-
- content
75+
- ACF fields, if applicable
8176
- all possible thumbnail sizes & URLs
8277
- Author, user_nicename, & Author ID
8378
- Categories
8479
- Category IDs
85-
- Tags
80+
- content
81+
- date (ISO 8601)
82+
- excerpt
83+
- id
84+
- slug
8685
- Tag IDs
87-
- ACF fields, if applicable
86+
- Tags
87+
- title
8888
- Yoast SEO fields, if applicable
8989

9090
### Pages
9191
**`better-rest-endpoints/v1/pages`**
9292
Gets a collection of pages. Accepts the following parameters:
9393

94+
- acf (boolean - setting to false omits `acf` from being returned)
95+
- content (boolean - setting to false hides the content from the response)
9496
- exclude (int)
95-
- orderby (string)
97+
- exclude (int) a post ID to exclude from the response
98+
- media (boolean - setting to false omits `media` (featured media) from being returned)
9699
- order (string - 'ASC' vs 'DESC')
97-
- per_page (int)
100+
- orderby (string)
98101
- page (int)
99-
- content (boolean - setting to false hides the content from the response)
100-
- exclude (int) a post ID to exclude from the response
101-
- acf (boolean - setting to false omits `acf` from being returned)
102+
- per_page (int)
102103
- yoast (boolean - setting to false omits `yoast` from being returned)
103-
- media (boolean - setting to false omits `media` (featured media) from being returned)
104104

105105
Returns the following JSON Response:
106106

107+
- ACF Fields
108+
- all possible thumbnail sizes & URLs
109+
- Content
107110
- ID
108111
- Slug
109112
- Template Name
110113
- Title
111-
- Content
112-
- ACF Fields
113114
- Yoast SEO Fields
114-
- all possible thumbnail sizes & URLs
115115

116116
### Page by ID
117117
**`better-rest-endpoints/v1/page/{id}`**
@@ -123,40 +123,40 @@ Accepts the following parameters:
123123

124124
Returns a JSON response with the following:
125125

126+
- ACF fields, if applicable
127+
- all possible thumbnail sizes & URLs
128+
- content
126129
- id
127130
- slug
128-
- title
129131
- template name
130-
- content
131-
- all possible thumbnail sizes & URLs
132-
- ACF fields, if applicable
132+
- title
133133
- Yoast SEO fields, if applicable
134134

135135
### Custom Post Type Collection
136136
**`better-rest-endpoints/v1/{custom_post_type}`**
137137
Gets a collection of posts from a custom post type. Accepts the following parameters:
138138

139-
- per_page (int)
140-
- page (int)
139+
- acf (boolean - setting to false omits `acf` from being returned)
141140
- content (boolean - setting to false omits `the_content` from being returned)
142-
- orderby (string) - see the [codex](https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters) for options, currently does not support multiple values
143141
- exclude (int) a post ID to exclude from the response
144-
- acf (boolean - setting to false omits `acf` from being returned)
145-
- yoast (boolean - setting to false omits `yoast` from being returned)
146142
- media (boolean - setting to false omits `media` (featured media) from being returned)
143+
- orderby (string) - see the [codex](https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters) for options, currently does not support multiple values
144+
- page (int)
145+
- per_page (int)
146+
- yoast (boolean - setting to false omits `yoast` from being returned)
147147

148148
Returns the following JSON response:
149149

150+
- ACF fields if applicable
151+
- all possible thumbnail sizes & URLs
152+
- Author, user_nicename, & Author ID
153+
- content
154+
- date (ISO 8601)
155+
- excerpt
150156
- ID
157+
- post terms
151158
- slug
152159
- title
153-
- date (ISO 8601)
154-
- post terms
155-
- excerpt
156-
- content
157-
- all possible thumbnail sizes & URLs
158-
- Author, user_nicename, & Author ID
159-
- ACF fields if applicable
160160
- Yoast SEO fields if applicable
161161

162162
### Custom Post Type Post by ID
@@ -167,16 +167,16 @@ Gets a single custom post type item. Accepts the following parameters:
167167

168168
Returns the following JSON Response:
169169

170+
- ACF Fields, if applicable
171+
- all possible thumbnail sizes & URLs
172+
- Author, user_nicename, & Author ID
173+
- content
174+
- date (ISO 8601)
175+
- excerpt
170176
- ID
177+
- post terms
171178
- slug
172179
- title
173-
- date (ISO 8601)
174-
- post terms
175-
- excerpt
176-
- content
177-
- all possible thumbnail sizes & URLs
178-
- Author, user_nicename, & Author ID
179-
- ACF Fields, if applicable
180180
- Yoast SEO Fields, if applicable
181181

182182
### Custom Post Type Post by Slug
@@ -187,43 +187,43 @@ Gets a single custom post type item. Accepts the following parameters:
187187

188188
Returns the following JSON Response:
189189

190+
- ACF Fields, if applicable
191+
- all possible thumbnail sizes & URLs
192+
- Author, user_nicename, & Author ID
193+
- content
194+
- date (ISO 8601)
195+
- excerpt
190196
- ID
197+
- post terms
191198
- slug
192199
- title
193-
- date (ISO 8601)
194-
- post terms
195-
- excerpt
196-
- content
197-
- all possible thumbnail sizes & URLs
198-
- Author, user_nicename, & Author ID
199-
- ACF Fields, if applicable
200200
- Yoast SEO Fields, if applicable
201201

202202
### Get Posts Belonging To A Taxonomy Term
203203
**`better-rest-endpoints/v1/{taxonomy}/{term}`**
204204
Gets posts from a taxonomy term. Accepts the following parameters:
205205

206-
- per_page (int)
207-
- page (int)
206+
- acf (boolean - setting to false omits `acf` from being returned)
208207
- content (boolean - setting to false omits `the_content` from being returned)
209-
- orderby (string) - see the [codex](https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters) for options, currently does not support multiple values
210208
- exclude (int) a post ID to exclude from the response
211-
- acf (boolean - setting to false omits `acf` from being returned)
212-
- yoast (boolean - setting to false omits `yoast` from being returned)
213209
- media (boolean - setting to false omits `media` (featured media) from being returned)
210+
- orderby (string) - see the [codex](https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters) for options, currently does not support multiple values
211+
- page (int)
212+
- per_page (int)
213+
- yoast (boolean - setting to false omits `yoast` from being returned)
214214

215215
Returns the following JSON Response:
216216

217+
- ACF Fields, if applicable
218+
- all possible thumbnail sizes & URLs
219+
- Author, user_nicename, & Author ID
220+
- content
221+
- date (ISO 8601)
222+
- excerpt
217223
- ID
224+
- post terms
218225
- slug
219226
- title
220-
- date (ISO 8601)
221-
- post terms
222-
- excerpt
223-
- content
224-
- all possible thumbnail sizes & URLs
225-
- Author, user_nicename, & Author ID
226-
- ACF Fields, if applicable
227227
- Yoast SEO Fields, if applicable
228228

229229
### Menus
@@ -232,55 +232,55 @@ Gets a WordPress Menu by slug. Accepts no parameters.
232232

233233
Returns the following JSON Response in each item object:
234234

235+
- classes (array)
236+
- description
235237
- ID
238+
- menu item parent
236239
- menu_order
237-
- title
238-
- url
239240
- slug
240241
- target
241-
- description
242-
- classes (array)
243-
- menu item parent
242+
- title
243+
- url
244244

245245
### Taxonomies
246246
**`better-rest-endpoints/v1/taxonomies`**
247247
Gets a list of taxonomies used by WordPress. Accepts no parameters.
248248

249249
Returns the following JSON response in each item object:
250250

251-
- Name
252-
- Slug
253251
- Description
254252
- Hierarchical (true/false)
253+
- Name
254+
- Slug
255255

256256
### Search
257257
**`better-rest-endpoints/v1/search`**
258258
Gets a collection of posts and pages based on the search parameter. Accepts the following parameters:
259259

260-
- page (int)
261-
- per_page (int)
260+
- acf (boolean - setting to false omits `acf` from being returned)
262261
- category id (int)
263-
- tag id (int)
264262
- content (boolean) set to false to omit content from showing in JSON response
263+
- media (boolean - setting to false omits `media` (featured media) from being returned)
264+
- page (int)
265+
- per_page (int)
265266
- search (string | required)
266-
- acf (boolean - setting to false omits `acf` from being returned)
267+
- tag id (int)
267268
- yoast (boolean - setting to false omits `yoast` from being returned)
268-
- media (boolean - setting to false omits `media` (featured media) from being returned)
269269

270270
It returns a JSON response with the following (returns an empty array if no posts found):
271-
- id
272-
- slug
273-
- title
274-
- date (ISO 8601)
275-
- excerpt
276-
- content
271+
- ACF fields, if applicable
277272
- all possible thumbnail sizes & URL
278273
- Author, user_nicename, & Author ID
279274
- Categories
280275
- Category IDs
281-
- Tags
276+
- content
277+
- date (ISO 8601)
278+
- excerpt
279+
- id
280+
- slug
282281
- Tag IDs
283-
- ACF fields, if applicable
282+
- Tags
283+
- title
284284
- Yoast SEO fields, if applicable
285285

286286
## Hooks and Filters

better-rest-endpoints.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Better Rest Endpoints
44
Plugin URI: https://github.com/factor1/better-rest-endpoints/
55
Description: Serves up slimmer WordPress Rest API endpoints, with some great enhancements.
6-
Version: 1.2.1
6+
Version: 1.3.0
77
Author: Eric Stout, Factor1 Studios
88
Author URI: https://factor1studios.com/
99
License: GPL3

includes/get_yoast.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
*
55
* @param none
66
* @return object|null Yoast object,
 * or null if none.
7-
* @since 1.2.1
7+
* @since 1.3.0
88
*/
99

1010
function bre_get_yoast( $post_ID = false ) {
11-
11+
1212
include_once ( ABSPATH . 'wp-admin/includes/plugin.php' );
1313

1414
// check if yoast is active before doing anything

0 commit comments

Comments
 (0)