Update with new event filters
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 11 Dec 2018 21:41:11 +0000 (16:41 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 11 Dec 2018 21:43:06 +0000 (16:43 -0500)
Filters for getting new drop downs.

parts/events-search-widget.php

index 7da8525..727b84d 100644 (file)
         </div>
         <div class="small-12 large-6 columns">
             <div class="up-form-wrapper">
+                <?php
+                $regions    = apply_filters( 'glm-member-db-events-get-region-search', '' );
+                $months     = apply_filters( 'glm-member-db-events-get-months-search', '' );
+                $categories = apply_filters( 'glm-member-db-events-get-category-search', '' );
+                ?>
                 <h4>Search For Events</h4>
+                <form action="<?php echo get_permalink( 1086 ) ; ?>" method="POST">
                 <form action="<?php echo get_permalink(757) ; ?>" method="POST">
-                    
-                    <select name="" id="">
+                    <select name="month" id="event-month">
                         <option value="">Filter By Month</option>
+                        <?php if ( isset( $months ) && !empty( $months ) ) {
+                            foreach ( $months as $month ) {
+                                echo '<option value="' . $month['monthval'] . '">' . $month['monthsel'] . '</option>';
+                            }
+                        } ?>
+                    </select>
+                    <select name="category" id="event-category">
+                        <option value="">All Categories</option>
+                        <?php if ( isset( $categories ) && !empty( $categories ) ) {
+                            foreach ( $categories as $category ) {
+                                echo '<option value="' . $category['id'] . '">' . $category['name'] . '</option>';
+                            }
+                        } ?>
+                    </select>
+                    <select name="region" id="event-region">
+                        <option value="">All Regions</option>
+                        <?php if ( isset( $regions ) && !empty( $regions ) ) {
+                            foreach ( $regions as $region ) {
+                                echo '<option value="' . $region['id'] . '">' . $region['name'] . '</option>';
+                            }
+                        } ?>
                     </select>
                     <select name="" id="">
                     <option value="">Filter By Topic</option>
@@ -27,8 +53,9 @@
                     <input class="events-search-button" type="submit" value="Search Events">
                     <input name="glm_event_from" type="hidden" value="">
                     <input name="glm_event_to" type="hidden" value="">
+                    <input type="submit" value="Search">
                 </form>
             </div>
         </div>
     </div>
-</div>
\ No newline at end of file
+</div>