Tribe__Tickets__Attendee_Registration__Template::setup_context( WP_Post[] $posts )

Setup the context


Parameters

$posts

(WP_Post[]) (Required) Post data objects.


Top ↑

Return

(array)


Top ↑

Source

File: src/Tribe/Attendee_Registration/Template.php

	public function setup_context( $posts ) {
		global $wp, $wp_query;

		// Bail if we're not on the attendee info page
		if ( ! $this->is_on_ar_page() ) {
			return $posts;
		}

		// Empty posts
		$posts = null;
		// Create a fake virtual page
		$posts[] = $this->spoofed_page();

		// Don't tell wp_query we're anything in particular - then we don't run into issues with defaults.
		$wp_query->is_page     = false;
		$wp_query->is_singular = false;
		$wp_query->is_home     = false;
		$wp_query->is_archive  = false;
		$wp_query->is_category = false;
		$wp_query->is_404      = false;
		$wp_query->found_posts = 1;
		$wp_query->posts_per_page = 1;

		return $posts;

	}

Top ↑

Changelog

Changelog
Version Description
5.9.1 changed page parameters and added page to the cache.
4.9 Introduced.