From 8a9af049ca234b43c7dc7d0d99b7504001337189 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Mon, 11 Apr 2016 14:20:47 +1000 Subject: [PATCH] Fix API errors --- includes/api/class-sp-rest-api.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/api/class-sp-rest-api.php b/includes/api/class-sp-rest-api.php index b93b35b6..7205732d 100644 --- a/includes/api/class-sp-rest-api.php +++ b/includes/api/class-sp-rest-api.php @@ -384,8 +384,8 @@ class SP_REST_API { public static function get_post_meta( $object, $field_name, $request ) { $meta = get_post_meta( $object['id'], self::meta_key( $field_name ), true ); - if ( ctype_digit( $value ) ) { - $value = intval( $value ); + if ( ctype_digit( $meta ) ) { + $meta = intval( $meta ); } return $meta; @@ -484,8 +484,8 @@ class SP_REST_API { 'post_type' => $meta_key, 'posts_per_page' => 2000, 'meta_query' => array( - 'key' => $object->type, - 'value' => $object->id, + 'key' => $object['type'], + 'value' => $object['id'], 'compare' => 'IN', ), );