Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions inc/class-eventbrite-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
7 changes: 7 additions & 0 deletions inc/class-eventbrite-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -335,6 +338,10 @@ protected function get_endpoint_params() {
'created_asc',
'created_desc',
),
'show_series_parent' => array(
true,
false,
),
),
);

Expand Down