Tribe__Events__REST__V1__Endpoints__Single_Venue::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)


Top ↑

Source

File: src/Tribe/REST/V1/Endpoints/Single_Venue.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 venue author ID', 'the-events-calendar' ),
			),
			'date'          => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_time' ),
				'type'              => 'string',
				'description'       => __( 'The venue publication date', 'the-events-calendar' ),
			),
			'date_utc'      => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_time' ),
				'type'              => 'string',
				'description'       => __( 'The venue publication date (UTC time zone)', 'the-events-calendar' ),
			),
			'venue'         => array(
				'required'          => true,
				'validate_callback' => array( $this->validator, 'is_string' ),
				'type'              => 'string',
				'description'       => __( 'The venue name', 'the-events-calendar' ),
			),
			'description'   => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_string_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The venue description', 'the-events-calendar' ),
			),
			'status'        => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_post_status' ),
				'type'              => 'string',
				'description'       => __( 'The venue post status', 'the-events-calendar' ),
			),
			// Venue meta fields
			'show_map'      => array(
				'required'    => false,
				'type'        => 'string',
				'default'     => null,
				'description' => __( 'Whether events linked to the venue should show a map or not', 'the-events-calendar' ),
			),
			'show_map_link' => array(
				'required'    => false,
				'type'        => 'string',
				'default'     => null,
				'description' => __( 'Whether events linked to the venue should show a map link or not', 'the-events-calendar' ),
			),
			'address'       => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_string_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The venue address', 'the-events-calendar' ),
			),
			'city'          => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_string_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The venue city', 'the-events-calendar' ),
			),
			'country'       => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_string_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The venue country', 'the-events-calendar' ),
			),
			'province'      => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_string_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The venue province', 'the-events-calendar' ),
			),
			'state'         => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_string_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The venue state', 'the-events-calendar' ),
			),
			'zip'           => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_string_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The venue ZIP code', 'the-events-calendar' ),
			),
			'phone'         => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_string_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The venue phone number', 'the-events-calendar' ),
			),
			'stateprovince' => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_string_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The venue state and province', 'the-events-calendar' ),
			),
			'website'       => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_url_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The venue website URL', 'the-events-calendar' ),
			),
			'image'         => array(
				'required'          => false,
				'validate_callback' => array( $this->validator, 'is_image_or_empty' ),
				'type'              => 'string',
				'default'           => null,
				'description'       => __( 'The organizer featured image ID or URL', 'the-events-calendar' ),
			),
		);
	}

Top ↑

Changelog

Changelog
Version Description
bucket/full-rest-api Introduced.