diff --git a/inc/class-eventbrite-api.php b/inc/class-eventbrite-api.php index 4f25302..8f300cd 100644 --- a/inc/class-eventbrite-api.php +++ b/inc/class-eventbrite-api.php @@ -93,6 +93,10 @@ public static function call( $endpoint, $query_params = array(), $object_id = nu $endpoint_url = trailingslashit( $endpoint_url . absint( $object_id ) ); } + if ( ! isset( $query_params['locale'] ) ) { + $query_params['locale'] = get_locale(); + } + if ( 'GET' == $method ) { $endpoint_url = add_query_arg( $query_params, $endpoint_url ); } else if ( 'POST' == $method ) { diff --git a/inc/class-eventbrite-manager.php b/inc/class-eventbrite-manager.php index a0c2b8b..673eee5 100644 --- a/inc/class-eventbrite-manager.php +++ b/inc/class-eventbrite-manager.php @@ -112,6 +112,9 @@ protected function validate_endpoint_params( $endpoint, $params ) { } unset( $params['page'] ); + // The 'locale' parameter is valid for any endpoint + unset( $params['locale'] ); + // Compare each passed parameter and value against our valid ones, and fail if a match can't be found. foreach ( $params as $key => $value ) { // Check the parameter is valid for that endpoint. @@ -335,6 +338,10 @@ protected function get_endpoint_params() { 'created_asc', 'created_desc', ), + 'show_series_parent' => array( + true, + false, + ), ), );