diff --git a/public_html/wp-content/themes/wporg-events-2023/functions.php b/public_html/wp-content/themes/wporg-events-2023/functions.php index 56a9b1d111..f96b2c360c 100644 --- a/public_html/wp-content/themes/wporg-events-2023/functions.php +++ b/public_html/wp-content/themes/wporg-events-2023/functions.php @@ -68,7 +68,7 @@ function get_country_options( array $options ): array { 'label' => __( 'Country', 'wporg' ), 'title' => __( 'Country', 'wporg' ), 'key' => 'country', - 'action' => home_url( '/upcoming-events/' ), + 'action' => home_url( '/upcoming/' ), 'options' => array( 'meetup' => 'Meetup', 'wordcamp' => 'WordCamp', @@ -96,7 +96,7 @@ function get_event_type_options( array $options ): array { 'label' => $label, 'title' => __( 'Type', 'wporg' ), 'key' => 'event_type', - 'action' => home_url( '/upcoming-events/' ), + 'action' => home_url( '/upcoming/' ), 'options' => array( 'meetup' => 'Meetup', 'wordcamp' => 'WordCamp', @@ -124,10 +124,10 @@ function get_format_type_options( array $options ): array { 'label' => $label, 'title' => __( 'Format', 'wporg' ), 'key' => 'format_type', - 'action' => home_url( '/upcoming-events/' ), + 'action' => home_url( '/upcoming/' ), 'options' => array( - 'meetup' => 'Online', - 'wordcamp' => 'In Person', + 'online' => 'Online', + 'in-person' => 'In Person', ), 'selected' => $selected, ); @@ -152,10 +152,11 @@ function get_month_options( array $options ): array { 'label' => $label, 'title' => __( 'Month', 'wporg' ), 'key' => 'month', - 'action' => home_url( '/upcoming-events/' ), + 'action' => home_url( '/upcoming/' ), 'options' => array( '01' => 'January', '02' => 'February', + // todo show all months on search and past events template, but only next ~3 months on upcoming events? ), 'selected' => $selected, ); diff --git a/public_html/wp-content/themes/wporg-events-2023/src/event-list/index.php b/public_html/wp-content/themes/wporg-events-2023/src/event-list/index.php index 16dea8eb9a..66ba89e213 100644 --- a/public_html/wp-content/themes/wporg-events-2023/src/event-list/index.php +++ b/public_html/wp-content/themes/wporg-events-2023/src/event-list/index.php @@ -39,13 +39,11 @@ function init() { */ function render( $attributes, $content, $block ) { $facets = array( - 'search' => get_query_var( 's' ) ?? '', - 'type' => get_query_var( 'event_type' ) ?? '', - 'format' => get_query_var( 'format_type' ) ?? '', - 'month' => get_query_var( 'month' ) ?? '', + 'search' => sanitize_text_field( get_query_var( 's' ) ?? '' ), + 'type' => sanitize_text_field( get_query_var( 'event_type' ) ?? '' ), + 'format' => sanitize_text_field( get_query_var( 'format_type' ) ?? '' ), + 'month' => absint( get_query_var( 'month' ) ?? 0 ), ); - array_walk( $facets, 'sanitize_text_field' ); - $facets = array_filter( $facets ); $events = get_events( $attributes['events'], 0, 0, $facets );