Tribe_Events::alter_context( Tribe__Context $context, array $arguments = array() )

Alters the shortcode context with its arguments.


Parameters

$context

(Tribe__Context) (Required) Context we will use to build the view.

$arguments

(array) (Optional) Arguments to be used to alter the context.

Default value: array()


Top ↑

Return

(Tribe__Context) Context after shortcodes changes.


Top ↑

Source

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

	public function alter_context( Context $context ) {
		$arguments    = $this->get_arguments();

		$alter_context = $this->args_to_context( $arguments );

		// The View will consume this information on initial state.
		$alter_context['shortcode'] = $this->get_id();

		if ( ! $alter_context ) {
			return $context;
		}

		$context = $context->alter( $alter_context );

		return $context;
	}

Top ↑

Changelog

Changelog
Version Description
4.7.9 Introduced.