Provider::filter_add_routes( Tribe__Events__Rewrite $rewrite )

Add rewrite routes for custom PRO stuff and views.


Parameters

$rewrite

(Tribe__Events__Rewrite) (Required) The Tribe__Events__Rewrite object


Top ↑

Return

(void)


Top ↑

Source

File: src/Tribe/Rewrite/Provider.php

	public function filter_add_routes( $rewrite ) {
		$rewrite
			->single( [ '(\d{4}-\d{2}-\d{2})' ], [ TEC::POSTTYPE => '%1', 'eventDate' => '%2' ] )
			->single( [ '(\d{4}-\d{2}-\d{2})', '(feed|rdf|rss|rss2|atom)' ], [
				TEC::POSTTYPE => '%1',
				'eventDate'   => '%2',
				'feed'        => '%3'
			] )
			->single( [ '(\d{4}-\d{2}-\d{2})', '(\d+)', '(feed|rdf|rss|rss2|atom)' ], [
				TEC::POSTTYPE   => '%1',
				'eventDate'     => '%2',
				'eventSequence' => '%3',
				'feed'          => '%4'
			] )
			->single( [ '(\d{4}-\d{2}-\d{2})', '(\d+)' ], [
				TEC::POSTTYPE   => '%1',
				'eventDate'     => '%2',
				'eventSequence' => '%3'
			] )
			->single( [ '(\d{4}-\d{2}-\d{2})', 'embed' ], [ TEC::POSTTYPE => '%1', 'eventDate' => '%2', 'embed' => 1 ] )
			->single( [ '{{ all }}', '{{ page }}', '(\d+)' ], [
				TEC::POSTTYPE           => '%1',
				'post_type'             => TEC::POSTTYPE,
				'eventDisplay'          => 'all',
				'tribe_recurrence_list' => true,
				'page'                 => '%2'
			] )
			->single( [ '{{ all }}' ], [
				TEC::POSTTYPE           => '%1',
				'post_type'             => TEC::POSTTYPE,
				'eventDisplay'          => 'all',
				'tribe_recurrence_list' => true
			] )
			->single( [ '(\d{4}-\d{2}-\d{2})', 'ical' ], [ TEC::POSTTYPE => '%1', 'eventDate' => '%2', 'ical' => 1 ] )
			->archive( [ '{{ week }}' ], [ 'eventDisplay' => 'week' ] )
			->archive( [ '{{ week }}', '{{ featured }}' ], [ 'eventDisplay' => 'week', 'featured' => true ] )
			->archive( [ '{{ week }}', '(\d{2})' ], [ 'eventDisplay' => 'week', 'eventDate' => '%1' ] )
			->archive( [ '{{ week }}', '(\d{2})', '{{ featured }}' ], [
				'eventDisplay' => 'week',
				'eventDate'    => '%1',
				'featured'     => true
			] )
			->archive( [ '{{ week }}', '(\d{4}-\d{2}-\d{2})' ], [ 'eventDisplay' => 'week', 'eventDate' => '%1' ] )
			->archive( [ '{{ week }}', '(\d{4}-\d{2}-\d{2})', '{{ featured }}' ], [
				'eventDisplay' => 'week',
				'eventDate'    => '%1',
				'featured'     => true
			] )
			->tax( [ '{{ week }}' ], [ 'eventDisplay' => 'week' ] )
			->tax( [ '{{ week }}', '{{ featured }}' ], [ 'eventDisplay' => 'week', 'featured' => true ] )
			->tax( [ '{{ week }}', '(\d{4}-\d{2}-\d{2})' ], [ 'eventDisplay' => 'week', 'eventDate' => '%2' ] )
			->tax( [ '{{ week }}', '(\d{4}-\d{2}-\d{2})', '{{ featured }}' ], [
				'eventDisplay' => 'week',
				'eventDate'    => '%2',
				'featured'     => true
			] )
			->tag( [ '{{ week }}' ], [ 'eventDisplay' => 'week' ] )
			->tag( [ '{{ week }}', '{{ featured }}' ], [ 'eventDisplay' => 'week', 'featured' => true ] )
			->tag( [ '{{ week }}', '(\d{4}-\d{2}-\d{2})' ], [ 'eventDisplay' => 'week', 'eventDate' => '%2' ] )
			->tag( [ '{{ week }}', '(\d{4}-\d{2}-\d{2})', '{{ featured }}' ], [
				'eventDisplay' => 'week',
				'eventDate'    => '%2',
				'featured'     => true
			] )
			->archive( [ '{{ photo }}' ], [ 'eventDisplay' => 'photo' ] )
			->archive( [ '{{ photo }}', '{{ featured }}' ], [ 'eventDisplay' => 'photo', 'featured' => true ] )
			->archive( [ '{{ photo }}', '(\d{4}-\d{2}-\d{2})' ], [ 'eventDisplay' => 'photo', 'eventDate' => '%1' ] )
			->archive( [ '{{ photo }}', '(\d{4}-\d{2}-\d{2})', '{{ featured }}' ], [
				'eventDisplay' => 'photo',
				'eventDate'    => '%1',
				'featured'     => true
			] )
			->tax( [ '{{ photo }}' ], [ 'eventDisplay' => 'photo' ] )
			->tax( [ '{{ photo }}', '{{ featured }}' ], [ 'eventDisplay' => 'photo', 'featured' => true ] )
			->tag( [ '{{ photo }}' ], [ 'eventDisplay' => 'photo' ] )
			->tag( [ '{{ photo }}', '{{ featured }}' ], [ 'eventDisplay' => 'photo', 'featured' => true ] );
	}

Top ↑

Changelog

Changelog
Version Description
4.7.5 Introduced.