Tribe__Events__REST__V1__Endpoints__Single_Event::CREATE_args()
Returns the content of the args array that should be used to register the endpoint with the register_rest_route function.
Return
(array)
Source
File: src/Tribe/REST/V1/Endpoints/Single_Event.php
public function CREATE_args() {
return array(
// Post fields
'author' => array(
'required' => false,
'validate_callback' => array( $this->validator, 'is_user_id' ),
'type' => 'integer',
'description' => __( 'The event author ID', 'the-events-calendar' ),
),
'date' => array(
'required' => false,
'validate_callback' => array( $this->validator, 'is_time' ),
'type' => 'string',
'description' => __( 'The event publication date', 'the-events-calendar' ),
),
'date_utc' => array(
'required' => false,
'validate_callback' => array( $this->validator, 'is_time' ),
'type' => 'string',
'description' => __( 'The event publication date (UTC time zone)', 'the-events-calendar' ),
),
'title' => array(
'required' => true,
'validate_callback' => array( $this->validator, 'is_string' ),
'type' => 'string',
'description' => __( 'The event title', 'the-events-calendar' ),
),
'description' => array(
'required' => false,
'validate_callback' => array( $this->validator, 'is_string' ),
'type' => 'string',
'description' => __( 'The event description', 'the-events-calendar' ),
),
'slug' => array(
'required' => false,
'validate_callback' => array( $this->validator, 'is_string' ),
'type' => 'string',
'description' => __( 'The event slug', 'the-events-calendar' ),
),
'excerpt' => array(
'required' => false,
'validate_callback' => array( $this->validator, 'is_string' ),
'type' => 'string',
'description' => __( 'The event excerpt', 'the-events-calendar' ),
),
'status' => array(
'required' => false,
'validate_callback' => array( $this->validator, 'is_post_status' ),
'type' => 'string',
'description' => __( 'The event post status', 'the-events-calendar' ),
),
// Event meta fields
'timezone' => array(
'required' => false,
'validate_callback' => array( $this->validator, 'is_timezone_or_empty' ),
'type' => 'string',
'description' => __( 'The event time zone', 'the-events-calendar' ),
),
'all_day' => array(
'required' => false,
'default' => false,
'type' => 'boolean',
'description' => __( 'Whether the event lasts the whole day or not', 'the-events-calendar' ),
),
'start_date' => array(
'required' => true,
'validate_callback' => array( $this->validator, 'is_time' ),
'type' => 'string',
'description' => __( 'The event start date and time', 'the-events-calendar' ),
),
'end_date' => array(
'required' => true,
'validate_callback' => array( $this->validator, 'is_time' ),
'type' => 'string',
'description' => __( 'The event end date and time', 'the-events-calendar' ),
),
'image' => array(
'required' => false,
'validate_callback' => array( $this->validator, 'is_image' ),
'type' => 'string',
'description' => __( 'The event featured image ID or URL', 'the-events-calendar' ),
),
'cost' => array(
'required' => false,
'swagger_type' => 'string',
'description' => __( 'The event cost', 'the-events-calendar' ),
),
'website' => array(
'required' => false,
'validate_callback' => array( $this->validator, 'is_url_or_empty' ),
'swagger_type' => 'string',
'default' => null,
'description' => __( 'The event website URL', 'the-events-calendar' ),
),
// Event presentation data
'show_map' => array(
'required' => false,
'type' => 'boolean',
'description' => __( 'Whether the event should show a map or not', 'the-events-calendar' ),
),
'show_map_link' => array(
'required' => false,
'type' => 'boolean',
'description' => __( 'Whether the event should show a map link or not', 'the-events-calendar' ),
),
'hide_from_listings' => array(
'required' => false,
'type' => 'boolean',
'description' => __( 'Whether events should be hidden in the calendar view or not', 'the-events-calendar' ),
),
'sticky' => array(
'required' => false,
'type' => 'boolean',
'description' => __( 'Whether the event should be sticky in the calendar view or not', 'the-events-calendar' ),
),
'featured' => array(
'required' => false,
'type' => 'boolean',
'description' => __( 'Whether the event should be featured on the site or not', 'the-events-calendar' ),
),
// Taxonomies
'categories' => array(
'required' => false,
'default' => null,
'swagger_type' => 'array',
'description' => __( 'The event category ID or name', 'the-events-calendar' ),
),
'tags' => array(
'required' => false,
'default' => null,
'swagger_type' => 'array',
'description' => __( 'The event tag ID or name', 'the-events-calendar' ),
),
// Linked Posts
'venue' => array(
'required' => false,
'default' => null,
'validate_callback' => array( $this->validator, 'is_venue_id_or_entry_or_empty' ),
'swagger_type' => 'array',
'items' => array( 'type' => 'integer' ),
'description' => __( 'The event venue ID or data', 'the-events-calendar' ),
),
'organizer' => array(
'required' => false,
'default' => null,
'validate_callback' => array( $this->validator, 'is_organizer_id_or_entry_or_empty' ),
'swagger_type' => 'array',
'items' => array( 'type' => 'integer' ),
'description' => __( 'The event organizer IDs or data', 'the-events-calendar' ),
),
);
}