Tribe__Events__REST__V1__Endpoints__Archive_Event::READ_args()

Returns the content of the args array that should be used to register the endpoint with the register_rest_route function.


Return

(array)


Top ↑

Source

File: src/Tribe/REST/V1/Endpoints/Archive_Event.php

	public function READ_args() {
		return array(
			'page'       => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_positive_int' ),
				'default'           => 1,
				'description'       => __( 'The archive page to return', 'the-events-calendar' ),
				'type'              => 'integer',
			),
			'per_page'   => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_positive_int' ),
				'sanitize_callback' => array( $this, 'sanitize_per_page' ),
				'default'           => $this->get_default_posts_per_page(),
				'description'       => __( 'The number of events to return on each page', 'the-events-calendar' ),
				'type'              => 'integer',
			),
			'start_date' => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_time' ),
				'default'           => Tribe__Timezones::localize_date( Tribe__Date_Utils::DBDATETIMEFORMAT, 'yesterday 23:59' ),
				'description'       => __( 'Events should start after the specified date', 'the-events-calendar' ),
				'swagger_type'      => 'string',
			),
			'end_date'   => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_time' ),
				'default'           => date( Tribe__Date_Utils::DBDATETIMEFORMAT, strtotime( '+24 months' ) ),
				'description'       => __( 'Events should start before the specified date', 'the-events-calendar' ),
				'swagger_type'      => 'string',
			),
			'search'     => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_string' ),
				'description'       => __( 'Events should contain the specified string in the title or description', 'the-events-calendar' ),
				'type'              => 'string',
			),
			'categories' => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_event_category' ),
				'description' => __( 'Events should be assigned one of the specified categories slugs or IDs', 'the-events-calendar' ),
				'swagger_type' => 'array',
				'items' => array( 'type' => 'integer' ),
				'collectionFormat' => 'csv',
			),
			'tags'       => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_post_tag' ),
				'description' => __( 'Events should be assigned one of the specified tags slugs or IDs', 'the-events-calendar' ),
				'swagger_type' => 'array',
				'items' => array( 'type' => 'integer' ),
				'collectionFormat' => 'csv',
			),
			'venue'      => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_venue_id_list' ),
				'description' => __( 'Events should be assigned one of the specified venue IDs', 'the-events-calendar' ),
				'swagger_type' => 'array',
				'items' => array( 'type' => 'integer' ),
				'collectionFormat' => 'csv',
			),
			'organizer'  => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_organizer_id_list' ),
				'description' => __( 'Events should be assigned one of the specified organizer IDs', 'the-events-calendar' ),
				'swagger_type' => 'array',
				'items' => array( 'type' => 'integer' ),
				'collectionFormat' => 'csv',
			),
			'featured'   => array(
				'required'    => false,
				'type'        => 'boolean',
				'description' => __( 'Events should be filtered by their featured status', 'the-events-calendar' ),
			),
			'status'     => array(
				'required'          => false,
				'validate_callback' => array( $this, 'filter_post_status_list' ),
				'swagger_type'      => 'string',
				'format'            => 'string',
				'description'       => __( 'The event post status', 'the-events-calendar' ),
			),
			'geoloc'     => array(
				'required'    => false,
				'type'        => 'boolean',
				'description' => __( 'Requires Events Calendar Pro. Events should be filtered by whether their venue has geolocation data', 'the-events-calendar' ),
			),
			'geoloc_lat' => array(
				'required'     => false,
				'swagger_type' => 'number',
				'format'       => 'double',
				'description'  => __( 'Requires Events Calendar Pro. Events should be filtered by their venue latitude location, must also provide geoloc_lng', 'the-events-calendar' ),
			),
			'geoloc_lng' => array(
				'required'     => false,
				'swagger_type' => 'number',
				'format'       => 'double',
				'description'  => __( 'Requires Events Calendar Pro. Events should be filtered by their venue longitude location, must also provide geoloc_lat', 'the-events-calendar' ),
			),
			'include' => array(
				'required'          => false,
				'description'       => __( 'Include events with one of the post IDs specified in the array of CSV list, date filters will be ignored.', 'the-events-calendar' ),
				'swagger_type'      => 'array',
				'items'             => array( 'type' => 'integer' ),
				'collectionFormat'  => 'csv',
				'validate_callback' => array( $this->validator, 'is_positive_int_list' ),
				'sanitize_callback' => array( 'Tribe__Utils__Array', 'list_to_array' ),
			),
			'post_parent' => array(
				'required'          => false,
				'type'              => 'integer',
				'description'       => __( 'Events should be filtered by their post_parent being the specified one.', 'the-events-calendar' ),
				'validate_callback' => array( $this->validator, 'is_event_id' ),
			),
		);
	}

Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.