FIX: Rest API not returns Critical Error when the user uses i.e. _fields=statistics of a player

This commit is contained in:
savvasha
2022-07-07 21:19:36 +03:00
parent ce755f50c1
commit 72b7a70c26

View File

@@ -844,7 +844,8 @@ if ( ! class_exists( 'SP_REST_API' ) ) :
* @return mixed * @return mixed
*/ */
public static function get_post_data( $object, $field_name, $request ) { 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'] ); $post = new $type( $object['id'] );