Post_Repository::__construct()

Post_Repository constructor.

Topics


Source #

File: src/Tribe/Repositories/Post_Repository.php

	public function __construct() {
		parent::__construct();

		$this->default_args = array_merge( $this->default_args, [
			'orderby'                      => 'date',
			'post_status'                  => 'any',
			'post_type'                    => 'any',
			// We'll be handling the dates, let's mark the query as a non-filtered one.
			'tribe_suppress_query_filters' => true,
		] );

		$this->schema = array_merge( $this->schema, [
			// These filter methods are added by the Event trait.
			'ends_after'           => [ $this, 'filter_by_ends_after' ],

			// These filter methods are added by the Post_Tickets trait.
			'cost'                 => [ $this, 'filter_by_cost' ],
			'cost_currency_symbol' => [ $this, 'filter_by_cost_currency_symbol' ],
			'has_tickets'          => [ $this, 'filter_by_has_tickets' ],
			'has_rsvp'             => [ $this, 'filter_by_has_rsvp' ],

			// These filter methods are added by the Post_Attendees trait.
			'has_attendees'        => [ $this, 'filter_by_has_attendees' ],
			'attendee'             => [ $this, 'filter_by_attendee' ],
			'attendee__not_in'     => [ $this, 'filter_by_attendee_not_in' ],
			'attendee_user'        => [ $this, 'filter_by_attendee_user' ],

			// This is not yet working, it needs more debugging to determine why it's not functional yet.
			//'attendee_user__not_in' => [ $this, 'filter_by_attendee_user_not_in' ],
		] );
	}