Fix API errors

This commit is contained in:
Brian Miyaji
2016-04-11 14:20:47 +10:00
parent 947e4cb33c
commit 8a9af049ca

View File

@@ -384,8 +384,8 @@ class SP_REST_API {
public static function get_post_meta( $object, $field_name, $request ) { public static function get_post_meta( $object, $field_name, $request ) {
$meta = get_post_meta( $object['id'], self::meta_key( $field_name ), true ); $meta = get_post_meta( $object['id'], self::meta_key( $field_name ), true );
if ( ctype_digit( $value ) ) { if ( ctype_digit( $meta ) ) {
$value = intval( $value ); $meta = intval( $meta );
} }
return $meta; return $meta;
@@ -484,8 +484,8 @@ class SP_REST_API {
'post_type' => $meta_key, 'post_type' => $meta_key,
'posts_per_page' => 2000, 'posts_per_page' => 2000,
'meta_query' => array( 'meta_query' => array(
'key' => $object->type, 'key' => $object['type'],
'value' => $object->id, 'value' => $object['id'],
'compare' => 'IN', 'compare' => 'IN',
), ),
); );