summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/giglogadmin-shortcodes.php4
-rw-r--r--includes/templates/giglogadmin-concerts-table.php43
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 @@
}
</style>
<div class="giglogadmin-concerts-table">
- <details class="giglogadmin-concerts-filter">
- <summary class="giglogadmin-concerts-filter-label">
- Filters
- </summary>
- <form name="giglogadmin-filter-city" action="" method="GET">
- <?php
- // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
- echo EternalTerror\ViewHelpers\select_field(
- 'city',
- array_map( fn( $c ) => 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'
- );
- ?>
- <input type="submit" value="Apply!">
- <a href="<?php echo esc_url( site_url( get_page_uri() ) ); ?>">Clear filters</a>
- </form>
-</details>
+ <div class="giglogadmin-concerts-filter">
+ <form name="giglogadmin-filter-city" action="" method="GET">
+ <label for="city">
+ Filter by city:
+ </label>
+ <?php
+ // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
+ echo EternalTerror\ViewHelpers\select_field(
+ 'city',
+ array_map( fn( $c ) => array( $c, $c ), GiglogAdmin_Venue::all_cities() ),
+ $filters['city'] ?? null
+ );
+ ?>
+ <input type="submit" value="Apply!">
+ <a href="<?php echo esc_url( site_url( get_page_uri() ) ); ?>">Clear filters</a>
+ </form>
+ </div>
<?php foreach ( $concerts as $concert ) { ?>
<div class="giglogadmin-concert">
<div class="giglogadmin-concert-title-row">