Add event format to REST API
This commit is contained in:
@@ -120,21 +120,37 @@ class SP_REST_API {
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_field( 'sp_event',
|
||||
'day',
|
||||
array(
|
||||
'get_callback' => 'SP_REST_API::get_post_data',
|
||||
'update_callback' => 'SP_REST_API::update_post_meta',
|
||||
'schema' => array(
|
||||
'description' => __( 'Match Day', 'sportspress' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
register_rest_field( 'sp_event',
|
||||
'format',
|
||||
array(
|
||||
'get_callback' => 'SP_REST_API::get_post_data',
|
||||
'update_callback' => 'SP_REST_API::update_post_meta',
|
||||
'schema' => array(
|
||||
'description' => __( 'Format', 'sportspress' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_field( 'sp_event',
|
||||
'day',
|
||||
array(
|
||||
'get_callback' => 'SP_REST_API::get_post_data',
|
||||
'update_callback' => 'SP_REST_API::update_post_meta',
|
||||
'schema' => array(
|
||||
'description' => __( 'Match Day', 'sportspress' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_field( 'sp_event',
|
||||
'minutes',
|
||||
|
||||
Reference in New Issue
Block a user