Organizer_View::next_url( $canonical = false,  $passthru_vars = array() )

{@inheritDoc}

Topics


Source #

File: src/Tribe/Views/V2/Views/Organizer_View.php

	public function next_url( $canonical = false, array $passthru_vars = [] ) {
		if ( isset( $this->cached_urls[ __METHOD__ ] ) ) {
			return $this->cached_urls[ __METHOD__ ];
		}

		$current_page = (int) $this->context->get( 'page', 1 );
		$display      = $this->context->get( 'event_display_mode', 'organizer' );

		if ( $this->slug === $display || 'default' === $display ) {
			$url = View::next_url( $canonical );
		} elseif ( $current_page > 1 ) {
			$url = View::prev_url( $canonical, [ Utils\View::get_past_event_display_key() => 'past' ] );
		} else {
			$url = $this->get_upcoming_url( $canonical );
		}

		$url = $this->filter_next_url( $canonical, $url );

		$this->cached_urls[ __METHOD__ ] = $url;

		return $url;
	}