Skip to content

Commit

Permalink
Merge branch 'hotfix/post-object'
Browse files Browse the repository at this point in the history
  • Loading branch information
erwstout committed Oct 26, 2017
2 parents 28a96ae + 9f7f1dd commit 5d71c09
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions 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.8
Version: 0.1.9
Author: Eric Stout, Factor1 Studios
Author URI: https://factor1studios.com/
License: GPL3
Expand Down Expand Up @@ -105,7 +105,7 @@ private function includes() {
include_once self::$plugin_dir . 'includes/get_tax.php';

// get custom taxonomies post endpoints
include_once self::$plugin_dir . 'includes/get_post_tax.php';
include_once self::$plugin_dir . 'includes/get_posts_tax.php';
}

}
Expand Down
11 changes: 8 additions & 3 deletions includes/get_post_tax.php → includes/get_posts_tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Get Posts by Taxonomy
*
* @param none
* @return object|null ACF object,
 * or null if none.
* @return endpoint returns a WordPress Rest API Endpoint
* @since 0.1.8
*/

Expand Down Expand Up @@ -56,11 +56,12 @@ function bwe_build_custom_tax_endpoint() {
if( $query->have_posts() ){

// setup post object
$bwe_tax_post = new stdClass();
$bwe_tax_posts = array();

while( $query->have_posts() ) {
$query->the_post();

$bwe_tax_post = new stdClass();

// get post data
$bwe_tax_post->id = get_the_ID();
Expand Down Expand Up @@ -115,9 +116,13 @@ function bwe_build_custom_tax_endpoint() {
$bwe_tax_post->media = false;
}

// push the post to the main array
array_push($bwe_tax_posts, $bwe_tax_post);

}
// return the post array
return $bwe_tax_posts;

return $bwe_tax_post;
} else {
// if no post is found
return array();
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.8",
"version": "0.1.9",
"description": "Serves up slimmer WordPress Rest API endpoints.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 5d71c09

Please sign in to comment.