From 711366c3512f79e2754b4bbc57dddd76e871267e Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 31 Jan 2023 22:36:52 +0100 Subject: Remove venue filter from shortcode. I don't really see a need for filtering by venue as well as city. This makes it easier, both for us and the visitors. --- includes/giglogadmin-shortcodes.php | 4 --- includes/templates/giglogadmin-concerts-table.php | 43 +++++++++-------------- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/includes/giglogadmin-shortcodes.php b/includes/giglogadmin-shortcodes.php index 8e410b2..5a3d70d 100644 --- a/includes/giglogadmin-shortcodes.php +++ b/includes/giglogadmin-shortcodes.php @@ -31,10 +31,6 @@ if ( ! function_exists( 'giglogadmin_shortcode_public' ) ) { $filters['city'] = sanitize_text_field( wp_unslash( $_GET['city'] ) ); } - if ( isset( $_GET['venue'] ) && ! empty( $_GET['venue'] ) ) { - $filters['venue'] = sanitize_text_field( wp_unslash( $_GET['venue'] ) ); - } - $concerts = GiglogAdmin_Concert::find_concerts( $filters ); ob_start(); diff --git a/includes/templates/giglogadmin-concerts-table.php b/includes/templates/giglogadmin-concerts-table.php index 93f5366..f38db3d 100644 --- a/includes/templates/giglogadmin-concerts-table.php +++ b/includes/templates/giglogadmin-concerts-table.php @@ -26,32 +26,23 @@ }
-
- - Filters - -
- array( $c, $c ), GiglogAdmin_Venue::all_cities() ), - $filters['city'] ?? null, - 'City' - ); - - // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped - echo EternalTerror\ViewHelpers\select_field( - 'venue', - array_map( fn( $v ) => array( $v->name(), "{$v->name()}, {$v->city()}" ), GiglogAdmin_Venue::all_venues() ), - $filters['venue'] ?? null, - 'Venue' - ); - ?> - - Clear filters -
-
+
+
+ + array( $c, $c ), GiglogAdmin_Venue::all_cities() ), + $filters['city'] ?? null + ); + ?> + + Clear filters +
+
-- cgit v1.2.3