summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2023-01-31 22:36:52 +0100
committerHarald Eilertsen <haraldei@anduin.net>2023-01-31 22:39:57 +0100
commit711366c3512f79e2754b4bbc57dddd76e871267e (patch)
tree4d91bf54cb13412d93480b5bca822237c3132583 /includes
parent0d7a4542ef0c0114ae9788c83df80993449b18ce (diff)
downloadgigologadmin-711366c3512f79e2754b4bbc57dddd76e871267e.tar.gz
gigologadmin-711366c3512f79e2754b4bbc57dddd76e871267e.tar.bz2
gigologadmin-711366c3512f79e2754b4bbc57dddd76e871267e.zip
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.
Diffstat (limited to 'includes')
-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">