diff --git a/includes/api/class-sp-rest-api.php b/includes/api/class-sp-rest-api.php index d61c2162..dee04181 100644 --- a/includes/api/class-sp-rest-api.php +++ b/includes/api/class-sp-rest-api.php @@ -844,7 +844,8 @@ if ( ! class_exists( 'SP_REST_API' ) ) : * @return mixed */ public static function get_post_data( $object, $field_name, $request ) { - $type = $object['type']; + //$type = $object['type']; + $type = get_post_type( $object['id'] ); $post = new $type( $object['id'] );