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', ), );