|
67 | 67 |
|
68 | 68 |
|
69 | 69 | <?php
|
70 |
| - $sunflower_terms = get_terms( |
71 |
| - array( |
72 |
| - 'taxonomy' => 'sunflower_event_tag', |
73 |
| - 'hide_empty' => true, |
74 |
| - ) |
75 |
| - ); |
76 | 70 |
|
77 |
| - if ( ! $sunflower_is_event_archive ) { |
78 |
| - foreach ( $sunflower_terms as $sunflower_term ) { |
79 |
| - printf( '<button class="filter" data-filter=".%s">%s</button>', esc_attr( $sunflower_term->slug ), esc_attr( $sunflower_term->name ) ); |
80 |
| - } |
| 71 | + $sunflower_ordered_posts = ( $sunflower_is_event_archive ) ? sunflower_get_past_events() : sunflower_get_next_events(); |
| 72 | + |
| 73 | + $sunflower_terms = wp_get_object_terms( wp_list_pluck( $sunflower_ordered_posts->posts, 'ID' ), 'sunflower_event_tag' ); |
| 74 | + foreach ( $sunflower_terms as $sunflower_term ) { |
| 75 | + printf( '<button class="filter" data-filter=".%s">%s</button>', esc_attr( $sunflower_term->slug ), esc_attr( $sunflower_term->name ) ); |
81 | 76 | }
|
82 | 77 | ?>
|
83 | 78 | </div>
|
84 | 79 |
|
85 | 80 | <div class="row event-list">
|
86 | 81 | <?php
|
87 | 82 |
|
88 |
| - $sunflower_ordered_posts = ( $sunflower_is_event_archive ) ? sunflower_get_past_events() : sunflower_get_next_events(); |
89 |
| - |
90 | 83 | /* Start the Loop */
|
91 | 84 | while ( $sunflower_ordered_posts->have_posts() ) {
|
92 | 85 | $sunflower_ordered_posts->the_post();
|
|
154 | 147 | "map.marker.push( { 'lat' : %s, 'lon': %s, 'content': '%s'} );",
|
155 | 148 | esc_attr( $sunflower_marker->lat ),
|
156 | 149 | esc_attr( $sunflower_marker->lon ),
|
157 |
| - esc_attr( $sunflower_marker->content ) |
| 150 | + wp_kses_post( $sunflower_marker->content ) |
158 | 151 | );
|
159 | 152 |
|
160 | 153 | $sunflower_lower_lat = min( $sunflower_lower_lat, $sunflower_marker->lat );
|
|
0 commit comments