Tribe_Events::filter_ff_link_next_event( TribeEventsProViewsV2ShortcodesTribe__Repository__Interface $next_event, TribeEventsViewsV2View_Interface $view )

Modify the events repository query for the fast-forward link.


Parameters

$next_event

(TribeEventsProViewsV2ShortcodesTribe__Repository__Interface) (Required) Current instance of the events repository class.

$view

(TribeEventsViewsV2View_Interface) (Required) The View currently rendering.


Top ↑

Return

(TribeEventsProViewsV2ShortcodesTribe__Repository__Interface) $next_event The modified repository instance.


Top ↑

Source

File: src/Tribe/Views/V2/Shortcodes/Tribe_Events.php

	public function filter_ff_link_next_event( $next_event, $view ) {
		$shortcode = $view->get_context()->get( 'shortcode' );
		if ( empty( $shortcode ) ) {
			return $next_event;
		}

		$args = $this->get_database_arguments( $shortcode );

		if ( ! empty( $args['category' ] ) ) {
			$next_event = $next_event->where( 'category', (array) $args['category'] );
		}

		if ( ! empty( $args['tag'] ) ) {
			$next_event = $next_event->where( 'tag', (array) $args['tag'] );
		}

		if ( ! empty( $args['exclude-category'] ) ) {
			$next_event = $next_event->where( 'category_not_in', (array) $args['exclude-category'] );
		}

		if ( ! empty( $args['exclude-tag'] ) ) {
			$next_event = $next_event->where( 'tag__not_in', (array) $args['exclude-tag'] );
		}

		if ( ! empty( $args['author'] ) ) {
			$next_event = $next_event->where( 'author', $args['author'] );
		}

		if ( ! empty( $args['organizer'] ) ) {
			$next_event = $next_event->where( 'organizer', $args['organizer'] );
		}

		if ( ! empty( $args['venue'] ) ) {
			$next_event = $next_event->where( 'venue', $args['venue'] );
		}


		return $next_event;
	}

Top ↑

Changelog

Changelog
Version Description
5.14.2 Introduced.