You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+103-103
Original file line number
Diff line number
Diff line change
@@ -7,34 +7,34 @@ A WordPress plugin that serves up slimmer WP Rest API endpoints.
7
7
**`better-rest-endpoints/v1/posts`**
8
8
Gets a collection of posts. Accepts the following parameters:
9
9
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)
12
12
- category id (int)
13
13
- category_name (string)
14
-
- tag id (int)
15
14
- content (boolean) set to false to omit content from showing in JSON response
16
-
- orderby (string)
17
-
- order (string - 'ASC' vs 'DESC')
18
15
- 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)
22
16
- 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)
23
23
24
24
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
31
26
- all possible thumbnail sizes & URL
32
27
- Author, user_nicename, & Author ID
33
28
- Categories
34
29
- Category IDs
35
-
- Tags
30
+
- content
31
+
- date (ISO 8601)
32
+
- excerpt
33
+
- id
34
+
- slug
36
35
- Tag IDs
37
-
- ACF fields, if applicable
36
+
- Tags
37
+
- title
38
38
- Yoast SEO fields, if applicable
39
39
40
40
### Post
@@ -47,19 +47,19 @@ Accepts the following parameters:
47
47
48
48
Returns a JSON response with the following:
49
49
50
-
- id
51
-
- slug
52
-
- title
53
-
- date (ISO 8601)
54
-
- excerpt
55
-
- content
50
+
- ACF fields, if applicable
56
51
- all possible thumbnail sizes & URLs
57
52
- Author, user_nicename, & Author ID
58
53
- Categories
59
54
- Category IDs
60
-
- Tags
55
+
- content
56
+
- date (ISO 8601)
57
+
- excerpt
58
+
- id
59
+
- slug
61
60
- Tag IDs
62
-
- ACF fields, if applicable
61
+
- Tags
62
+
- title
63
63
- Yoast SEO fields, if applicable
64
64
65
65
### Post by slug
@@ -72,46 +72,46 @@ Accepts the following parameters:
72
72
73
73
Returns a JSON response with the following:
74
74
75
-
- id
76
-
- slug
77
-
- title
78
-
- date (ISO 8601)
79
-
- excerpt
80
-
- content
75
+
- ACF fields, if applicable
81
76
- all possible thumbnail sizes & URLs
82
77
- Author, user_nicename, & Author ID
83
78
- Categories
84
79
- Category IDs
85
-
- Tags
80
+
- content
81
+
- date (ISO 8601)
82
+
- excerpt
83
+
- id
84
+
- slug
86
85
- Tag IDs
87
-
- ACF fields, if applicable
86
+
- Tags
87
+
- title
88
88
- Yoast SEO fields, if applicable
89
89
90
90
### Pages
91
91
**`better-rest-endpoints/v1/pages`**
92
92
Gets a collection of pages. Accepts the following parameters:
93
93
94
+
- acf (boolean - setting to false omits `acf` from being returned)
95
+
- content (boolean - setting to false hides the content from the response)
94
96
- 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)
96
99
- order (string - 'ASC' vs 'DESC')
97
-
-per_page (int)
100
+
-orderby (string)
98
101
- 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)
102
103
- yoast (boolean - setting to false omits `yoast` from being returned)
103
-
- media (boolean - setting to false omits `media` (featured media) from being returned)
104
104
105
105
Returns the following JSON Response:
106
106
107
+
- ACF Fields
108
+
- all possible thumbnail sizes & URLs
109
+
- Content
107
110
- ID
108
111
- Slug
109
112
- Template Name
110
113
- Title
111
-
- Content
112
-
- ACF Fields
113
114
- Yoast SEO Fields
114
-
- all possible thumbnail sizes & URLs
115
115
116
116
### Page by ID
117
117
**`better-rest-endpoints/v1/page/{id}`**
@@ -123,40 +123,40 @@ Accepts the following parameters:
123
123
124
124
Returns a JSON response with the following:
125
125
126
+
- ACF fields, if applicable
127
+
- all possible thumbnail sizes & URLs
128
+
- content
126
129
- id
127
130
- slug
128
-
- title
129
131
- template name
130
-
- content
131
-
- all possible thumbnail sizes & URLs
132
-
- ACF fields, if applicable
132
+
- title
133
133
- Yoast SEO fields, if applicable
134
134
135
135
### Custom Post Type Collection
136
136
**`better-rest-endpoints/v1/{custom_post_type}`**
137
137
Gets a collection of posts from a custom post type. Accepts the following parameters:
138
138
139
-
- per_page (int)
140
-
- page (int)
139
+
- acf (boolean - setting to false omits `acf` from being returned)
141
140
- 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
143
141
- 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)
146
142
- 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)
147
147
148
148
Returns the following JSON response:
149
149
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
150
156
- ID
157
+
- post terms
151
158
- slug
152
159
- 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
160
160
- Yoast SEO fields if applicable
161
161
162
162
### Custom Post Type Post by ID
@@ -167,16 +167,16 @@ Gets a single custom post type item. Accepts the following parameters:
167
167
168
168
Returns the following JSON Response:
169
169
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
170
176
- ID
177
+
- post terms
171
178
- slug
172
179
- 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
180
180
- Yoast SEO Fields, if applicable
181
181
182
182
### Custom Post Type Post by Slug
@@ -187,43 +187,43 @@ Gets a single custom post type item. Accepts the following parameters:
187
187
188
188
Returns the following JSON Response:
189
189
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
190
196
- ID
197
+
- post terms
191
198
- slug
192
199
- 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
200
200
- Yoast SEO Fields, if applicable
201
201
202
202
### Get Posts Belonging To A Taxonomy Term
203
203
**`better-rest-endpoints/v1/{taxonomy}/{term}`**
204
204
Gets posts from a taxonomy term. Accepts the following parameters:
205
205
206
-
- per_page (int)
207
-
- page (int)
206
+
- acf (boolean - setting to false omits `acf` from being returned)
208
207
- 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
210
208
- 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)
213
209
- 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)
214
214
215
215
Returns the following JSON Response:
216
216
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
217
223
- ID
224
+
- post terms
218
225
- slug
219
226
- 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
227
227
- Yoast SEO Fields, if applicable
228
228
229
229
### Menus
@@ -232,55 +232,55 @@ Gets a WordPress Menu by slug. Accepts no parameters.
232
232
233
233
Returns the following JSON Response in each item object:
234
234
235
+
- classes (array)
236
+
- description
235
237
- ID
238
+
- menu item parent
236
239
- menu_order
237
-
- title
238
-
- url
239
240
- slug
240
241
- target
241
-
- description
242
-
- classes (array)
243
-
- menu item parent
242
+
- title
243
+
- url
244
244
245
245
### Taxonomies
246
246
**`better-rest-endpoints/v1/taxonomies`**
247
247
Gets a list of taxonomies used by WordPress. Accepts no parameters.
248
248
249
249
Returns the following JSON response in each item object:
250
250
251
-
- Name
252
-
- Slug
253
251
- Description
254
252
- Hierarchical (true/false)
253
+
- Name
254
+
- Slug
255
255
256
256
### Search
257
257
**`better-rest-endpoints/v1/search`**
258
258
Gets a collection of posts and pages based on the search parameter. Accepts the following parameters:
259
259
260
-
- page (int)
261
-
- per_page (int)
260
+
- acf (boolean - setting to false omits `acf` from being returned)
262
261
- category id (int)
263
-
- tag id (int)
264
262
- 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)
265
266
- search (string | required)
266
-
-acf (boolean - setting to false omits `acf` from being returned)
267
+
-tag id (int)
267
268
- yoast (boolean - setting to false omits `yoast` from being returned)
268
-
- media (boolean - setting to false omits `media` (featured media) from being returned)
269
269
270
270
It returns a JSON response with the following (returns an empty array if no posts found):
0 commit comments