From 6f3f186678bbecd0ec2eef656ea0cde65bfcca49 Mon Sep 17 00:00:00 2001 From: Makis Tracend Date: Sat, 4 Feb 2017 00:06:29 -0800 Subject: [PATCH] enabling force flag --- inc/class-eventbrite-query.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/inc/class-eventbrite-query.php b/inc/class-eventbrite-query.php index 721651c..b156220 100644 --- a/inc/class-eventbrite-query.php +++ b/inc/class-eventbrite-query.php @@ -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'] ) ) { @@ -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.