Fix rest api field types

This commit is contained in:
Brian Miyaji
2016-04-11 02:09:32 +10:00
parent fa642c854f
commit 2e68288606
3 changed files with 4 additions and 4 deletions

View File

@@ -145,7 +145,7 @@ class SP_REST_API {
'get_callback' => 'SP_REST_API::get_post_data',
'schema' => array(
'description' => __( 'Winner', 'sportspress' ),
'type' => 'array',
'type' => 'integer',
'context' => array( 'view', 'embed' ),
'arg_options' => array(
'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 ) {
$meta = get_post_meta( $object['id'], self::meta_key( $field_name ), false );
return array_map( 'absint', $meta );
return array_map( 'intval', $meta );
}
/**

View File

@@ -141,7 +141,7 @@ class SportsPress_Calendars {
'update_callback' => 'SP_REST_API::update_post_meta',
'schema' => array(
'description' => __( 'Layout', 'sportspress' ),
'type' => 'array',
'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ),
'arg_options' => array(
'sanitize_callback' => 'rest_sanitize_request_arg',

View File

@@ -141,7 +141,7 @@ class SportsPress_Player_Lists {
'update_callback' => 'SP_REST_API::update_post_meta',
'schema' => array(
'description' => __( 'Layout', 'sportspress' ),
'type' => 'array',
'type' => 'string',
'context' => array( 'view', 'edit', 'embed' ),
'arg_options' => array(
'sanitize_callback' => 'rest_sanitize_request_arg',