Tribe__Events__Repositories__Event::filter_by_hidden_on_upcoming( bool $hidden )

Filters events by their “Hidden from Event Listings” status.

This method assumes that we keep the following structure:

  • if an event should be hidden its _EventHideFromUpcoming meta will be set to yes (or another truthy value).
  • if an event should not be hidden its _EventHideFromUpcoming meta will not be set at all.

Parameters

$hidden

(bool) (Required) Whether the events should be hidden from event listings or not.


Top ↑

Source

File: src/Tribe/Repositories/Event.php

	public function filter_by_hidden_on_upcoming( $hidden ) {
		$hidden = tribe_is_truthy( $hidden );

		if ( $hidden ) {
			$this->by( 'meta_equals', '_EventHideFromUpcoming', 'yes' );

			return;
		}

		$this->by( 'meta_not_exists', '_EventHideFromUpcoming' );
	}

Top ↑

Changelog

Changelog
Version Description
4.9.11 Introduced.