Skip to content

Commit c1a303d

Browse files
committed
Merge branch 'develop'
2 parents 62d8ee7 + 9bafc85 commit c1a303d

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Gets posts from a taxonomy term. Accepts rthe following parameters:
158158
- per_page (int)
159159
- page (int)
160160
- content (boolean - setting to false omits `the_content` from being returned)
161+
- 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
161162

162163
Returns the following JSON Response:
163164

better-wp-endpoints.php

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

includes/get_posts_tax.php

+2
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ function bwe_build_custom_tax_endpoint() {
3636
$posts_per_page = $request['per_page']?: '10';
3737
$page = $request['page']?: '1';
3838
$show_content = $request['content']?: 'true';
39+
$orderby = $request['orderby']? : null;
3940

4041
// WP_Query Arguments
4142
$args = array(
4243
'nopaging' => false,
4344
'posts_per_page' => $posts_per_page,
45+
'orderby' => $orderby
4446
'tax_query' => array(
4547
array(
4648
'taxonomy' => $tax,

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "better-wp-endpoints",
3-
"version": "0.1.12",
3+
"version": "0.1.13",
44
"description": "Serves up slimmer WordPress Rest API endpoints.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)