Tribe_Events::filter_view_context( Tribe__Context $view_context, string $view_slug, TribeEventsViewsV2View $instance )

Alters the context of the view based on the shortcode params stored in the database based on the ID.


Parameters

$view_context

(Tribe__Context) (Required) Context for this request.

$view_slug

(string) (Required) Slug of the view we are building.

$instance

(TribeEventsViewsV2View) (Required) Which view instance we are dealing with.


Top ↑

Return

(Tribe__Context) Altered version of the context ready for shortcodes.


Top ↑

Source

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

	public function filter_view_context( Context $view_context, $view_slug, $instance ) {
		if ( ! $shortcode_id = $view_context->get( 'shortcode' ) ) {
			return $view_context;
		}

		$arguments = $this->get_database_arguments( $shortcode_id );

		if ( empty( $arguments ) ) {
			return $view_context;
		}

		return $this->alter_context( $view_context, $arguments );
	}

Top ↑

Changelog

Changelog
Version Description
5.0.0 Introduced.