Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions inc/class-eventbrite-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ protected function process_query_args( $query ) {
public function get_posts() {
// Set up query variables.
$this->parse_query();
// force flag
$force = ( isset( $this->query_vars['force'] ) ) ? $this->query_vars['force'] : false;

// Restore `paged` if changed to `page` (in the case of index pagination).
if ( ! empty( $this->query_vars['page'] ) ) {
Expand All @@ -109,17 +111,17 @@ public function get_posts() {

// Determine which endpoint is needed. Do we want just a single event?
if ( ! empty( $this->query_vars['p'] ) ) {
$this->api_results = eventbrite()->get_event( $this->query_vars['p'] );
$this->api_results = eventbrite()->get_event( $this->query_vars['p'], $force );
}

// If private events are wanted, the user_owned_events endpoint must be used.
elseif ( isset( $this->query_vars['display_private'] ) && true === $this->query_vars['display_private'] ) {
$this->api_results = eventbrite()->get_user_owned_events( $params );
$this->api_results = eventbrite()->get_user_owned_events( $params, $force );
}

// It's a run-of-the-mill query (only the user's public live events), meaning event_search is best.
else {
$this->api_results = eventbrite()->do_event_search( $params );
$this->api_results = eventbrite()->do_event_search( $params, $force );
}

// Do any post-API query processing.
Expand Down