Fix rest api field types
This commit is contained in:
@@ -145,7 +145,7 @@ class SP_REST_API {
|
|||||||
'get_callback' => 'SP_REST_API::get_post_data',
|
'get_callback' => 'SP_REST_API::get_post_data',
|
||||||
'schema' => array(
|
'schema' => array(
|
||||||
'description' => __( 'Winner', 'sportspress' ),
|
'description' => __( 'Winner', 'sportspress' ),
|
||||||
'type' => 'array',
|
'type' => 'integer',
|
||||||
'context' => array( 'view', 'embed' ),
|
'context' => array( 'view', 'embed' ),
|
||||||
'arg_options' => array(
|
'arg_options' => array(
|
||||||
'sanitize_callback' => 'rest_sanitize_request_arg',
|
'sanitize_callback' => 'rest_sanitize_request_arg',
|
||||||
@@ -456,7 +456,7 @@ class SP_REST_API {
|
|||||||
public static function get_post_meta_recursive( $object, $field_name, $request ) {
|
public static function get_post_meta_recursive( $object, $field_name, $request ) {
|
||||||
$meta = get_post_meta( $object['id'], self::meta_key( $field_name ), false );
|
$meta = get_post_meta( $object['id'], self::meta_key( $field_name ), false );
|
||||||
|
|
||||||
return array_map( 'absint', $meta );
|
return array_map( 'intval', $meta );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class SportsPress_Calendars {
|
|||||||
'update_callback' => 'SP_REST_API::update_post_meta',
|
'update_callback' => 'SP_REST_API::update_post_meta',
|
||||||
'schema' => array(
|
'schema' => array(
|
||||||
'description' => __( 'Layout', 'sportspress' ),
|
'description' => __( 'Layout', 'sportspress' ),
|
||||||
'type' => 'array',
|
'type' => 'string',
|
||||||
'context' => array( 'view', 'edit', 'embed' ),
|
'context' => array( 'view', 'edit', 'embed' ),
|
||||||
'arg_options' => array(
|
'arg_options' => array(
|
||||||
'sanitize_callback' => 'rest_sanitize_request_arg',
|
'sanitize_callback' => 'rest_sanitize_request_arg',
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class SportsPress_Player_Lists {
|
|||||||
'update_callback' => 'SP_REST_API::update_post_meta',
|
'update_callback' => 'SP_REST_API::update_post_meta',
|
||||||
'schema' => array(
|
'schema' => array(
|
||||||
'description' => __( 'Layout', 'sportspress' ),
|
'description' => __( 'Layout', 'sportspress' ),
|
||||||
'type' => 'array',
|
'type' => 'string',
|
||||||
'context' => array( 'view', 'edit', 'embed' ),
|
'context' => array( 'view', 'edit', 'embed' ),
|
||||||
'arg_options' => array(
|
'arg_options' => array(
|
||||||
'sanitize_callback' => 'rest_sanitize_request_arg',
|
'sanitize_callback' => 'rest_sanitize_request_arg',
|
||||||
|
|||||||
Reference in New Issue
Block a user