Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
erwstout committed Nov 28, 2017
2 parents bf5f3c2 + 4080e6d commit b866527
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Gets a collection of posts. Accepts the following parameters:
- content (boolean) set to false to omit content from showing in JSON response
- orderby (string)
- order (string - 'ASC' vs 'DESC')
- exclude (int) a post ID to exclude from the response

It returns a JSON response with the following:
- id
Expand Down
2 changes: 1 addition & 1 deletion better-wp-endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Better WordPress Endpoints
Plugin URI: https://github.com/factor1/better-wp-endpoints/
Description: Serves up slimmer WordPress Rest API endpoints, with some great enhancements.
Version: 0.1.17
Version: 0.1.18
Author: Eric Stout, Factor1 Studios
Author URI: https://factor1studios.com/
License: GPL3
Expand Down
4 changes: 3 additions & 1 deletion includes/get_posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function bwe_get_posts( WP_REST_Request $request ) {
$show_content = $request['content']?: true;
$orderby = $request['orderby']?: null;
$order = $request['order']?: null;
$exclude = $request['exclude']?: null;

// WP_Query arguments
$args = array(
Expand All @@ -26,7 +27,8 @@ function bwe_get_posts( WP_REST_Request $request ) {
'cat' => $category,
'tag_id' => $tag,
'order' => $order?:'DESC',
'orderby' => $orderby?:'date'
'orderby' => $orderby?:'date',
'post__not_in' => array($exclude)
);

// The Query
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "better-wp-endpoints",
"version": "0.1.17",
"version": "0.1.18",
"description": "Serves up slimmer WordPress Rest API endpoints.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit b866527

Please sign in to comment.