Events Manager - Version 5.12

Version Description

  • changed EM_Booking::$disable_restricions so that all ticket restrictions can ignored for admin manual bookings (pro feature) including spaces, roles and dates
  • added taxonomy filters for Meta Tag Manager compatibility on overriden taxonomy pages
  • added filters to Event_Locations\Event_Location and Event_Locations\URL
  • added filters to EM_Events::output_grouped()
  • fixed #_EVENTDATES_LOCAL and #_24HHTIMES_LOCAL showing time/date range even if time/dates are the same
  • fixed XSS security vulnerability reported by/via WP Plugins team
Download this release

Release Info

Developer netweblogic
Plugin Icon 128x128 Events Manager
Version 5.12
Comparing to
See all releases

Code changes from version 5.11 to 5.12

classes/em-event.php CHANGED
@@ -2237,7 +2237,7 @@ class EM_Event extends EM_Object{
2237
  case '#_24HENDTIME_LOCAL':
2238
  case '#_24HTIMES_LOCAL':
2239
  $ts = ($result == '#_24HENDTIME_LOCAL') ? $this->end()->getTimestamp():$this->start()->getTimestamp();
2240
- $date_end = ($result == '#_24HTIMES_LOCAL' && $this->end()->getTimestamp() !== $ts) ? 'data-time-end="'. esc_attr($this->end()->getTimestamp()) .'" data-separator="'. esc_attr(get_option('dbem_times_separator')) . '"' : '';
2241
  $replace = '<span class="em-time-localjs" data-time-format="24" data-time="'. esc_attr($ts) .'" '. $date_end .'>JavaScript Disabled</span>';
2242
  break;
2243
  case '#_12HSTARTTIME':
@@ -2292,9 +2292,13 @@ class EM_Event extends EM_Object{
2292
  }
2293
  if( $result === '#_EVENTDATES_LOCAL' ){
2294
  $time_format = ( get_option('dbem_date_format') ) ? get_option('dbem_date_format'):get_option('date_format');
 
 
2295
  if( empty($separator) ) $separator = get_option('dbem_dates_separator');
2296
  }else{
2297
  $time_format = ( get_option('dbem_time_format') ) ? get_option('dbem_time_format'):get_option('time_format');
 
 
2298
  if( empty($separator) ) $separator = get_option('dbem_times_separator');
2299
  }
2300
  $time_format = strtr($time_format, $replacements);
@@ -2303,7 +2307,7 @@ class EM_Event extends EM_Object{
2303
  // start output
2304
  ob_start();
2305
  ?>
2306
- <span class="em-date-momentjs" data-date-format="<?php echo esc_attr($time_format); ?>" data-date-start="<?php echo $this->start()->getTimestamp() ?>" data-date-end="<?php echo $this->end()->getTimestamp() ?>" data-date-separator="<?php echo esc_attr($separator); ?>">JavaScript Disabled</span>
2307
  <?php
2308
  $replace = ob_get_clean();
2309
  }
2237
  case '#_24HENDTIME_LOCAL':
2238
  case '#_24HTIMES_LOCAL':
2239
  $ts = ($result == '#_24HENDTIME_LOCAL') ? $this->end()->getTimestamp():$this->start()->getTimestamp();
2240
+ $date_end = ($result == '#_24HTIMES_LOCAL' && $this->event_start_time !== $this->event_end_time) ? 'data-time-end="'. esc_attr($this->end()->getTimestamp()) .'" data-separator="'. esc_attr(get_option('dbem_times_separator')) . '"' : '';
2241
  $replace = '<span class="em-time-localjs" data-time-format="24" data-time="'. esc_attr($ts) .'" '. $date_end .'>JavaScript Disabled</span>';
2242
  break;
2243
  case '#_12HSTARTTIME':
2292
  }
2293
  if( $result === '#_EVENTDATES_LOCAL' ){
2294
  $time_format = ( get_option('dbem_date_format') ) ? get_option('dbem_date_format'):get_option('date_format');
2295
+ $start_time = $this->start()->getTimestamp();
2296
+ $end_time = $this->event_start_date == $this->event_end_date ? $start_time : $this->end()->getTimestamp();
2297
  if( empty($separator) ) $separator = get_option('dbem_dates_separator');
2298
  }else{
2299
  $time_format = ( get_option('dbem_time_format') ) ? get_option('dbem_time_format'):get_option('time_format');
2300
+ $start_time = $this->start()->getTimestamp();
2301
+ $end_time = $this->event_start_time == $this->event_end_time ? $start_time : $this->end()->getTimestamp();
2302
  if( empty($separator) ) $separator = get_option('dbem_times_separator');
2303
  }
2304
  $time_format = strtr($time_format, $replacements);
2307
  // start output
2308
  ob_start();
2309
  ?>
2310
+ <span class="em-date-momentjs" data-date-format="<?php echo esc_attr($time_format); ?>" data-date-start="<?php echo $start_time ?>" data-date-end="<?php echo $end_time ?>" data-date-separator="<?php echo esc_attr($separator); ?>">JavaScript Disabled</span>
2311
  <?php
2312
  $replace = ob_get_clean();
2313
  }
classes/em-events.php CHANGED
@@ -395,6 +395,7 @@ $limit $offset";
395
  }
396
  }
397
  }
 
398
  foreach ($events_dates as $year => $events){
399
  $EM_DateTime = new EM_DateTime($year.'-01-01');
400
  echo str_replace('#s', $EM_DateTime->i18n($format), $args['header_format']);
@@ -417,6 +418,7 @@ $limit $offset";
417
  }
418
  }
419
  }
 
420
  foreach ($events_dates as $month => $events){
421
  $EM_DateTime = new EM_DateTime($month);
422
  echo str_replace('#s', $EM_DateTime->i18n($format), $args['header_format']);
@@ -443,6 +445,7 @@ $limit $offset";
443
  }while( $EM_DateTime <= $EM_Event->end() );
444
  }
445
  }
 
446
  foreach ($events_dates as $date => $events){
447
  $dates_formatted = $EM_DateTime->modify($date)->i18n($format). get_option('dbem_dates_separator') . $EM_DateTime->add('P6D')->i18n($format);
448
  echo str_replace('#s', $dates_formatted, $args['header_format']);
@@ -465,6 +468,7 @@ $limit $offset";
465
  }while( $EM_DateTime <= $EM_Event->end() );
466
  }
467
  }
 
468
  foreach ($events_dates as $date => $events){
469
  echo str_replace('#s', $EM_DateTime->modify($date)->i18n($format), $args['header_format']);
470
  echo self::output($events, $atts);
@@ -478,7 +482,7 @@ $limit $offset";
478
  }elseif( $args['no_results_msg'] !== false ){
479
  echo !empty($args['no_results_msg']) ? $args['no_results_msg'] : get_option('dbem_no_events_message');
480
  }
481
- return ob_get_clean();
482
  }
483
 
484
  public static function get_pagination_links($args, $count, $search_action = 'search_events', $default_args = array()){
395
  }
396
  }
397
  }
398
+ $events_dates = apply_filters('em_events_output_grouped_events_dates', $events_dates, $args);
399
  foreach ($events_dates as $year => $events){
400
  $EM_DateTime = new EM_DateTime($year.'-01-01');
401
  echo str_replace('#s', $EM_DateTime->i18n($format), $args['header_format']);
418
  }
419
  }
420
  }
421
+ $events_dates = apply_filters('em_events_output_grouped_events_dates', $events_dates, $args);
422
  foreach ($events_dates as $month => $events){
423
  $EM_DateTime = new EM_DateTime($month);
424
  echo str_replace('#s', $EM_DateTime->i18n($format), $args['header_format']);
445
  }while( $EM_DateTime <= $EM_Event->end() );
446
  }
447
  }
448
+ $events_dates = apply_filters('em_events_output_grouped_events_dates', $events_dates, $args);
449
  foreach ($events_dates as $date => $events){
450
  $dates_formatted = $EM_DateTime->modify($date)->i18n($format). get_option('dbem_dates_separator') . $EM_DateTime->add('P6D')->i18n($format);
451
  echo str_replace('#s', $dates_formatted, $args['header_format']);
468
  }while( $EM_DateTime <= $EM_Event->end() );
469
  }
470
  }
471
+ $events_dates = apply_filters('em_events_output_grouped_events_dates', $events_dates, $args);
472
  foreach ($events_dates as $date => $events){
473
  echo str_replace('#s', $EM_DateTime->modify($date)->i18n($format), $args['header_format']);
474
  echo self::output($events, $atts);
482
  }elseif( $args['no_results_msg'] !== false ){
483
  echo !empty($args['no_results_msg']) ? $args['no_results_msg'] : get_option('dbem_no_events_message');
484
  }
485
+ return apply_filters('em_events_output_grouped', ob_get_clean(), $events, $args);
486
  }
487
 
488
  public static function get_pagination_links($args, $count, $search_action = 'search_events', $default_args = array()){
classes/em-taxonomy-frontend.php CHANGED
@@ -83,6 +83,15 @@ class EM_Taxonomy_Frontend {
83
  //sort out filters
84
  add_filter('wp_head', 'EM_Taxonomy_Frontend::remove_em_the_content', 10000);
85
  add_filter('the_content', array(self::$this_class,'the_content')); //come in slightly early and consider other plugins
 
 
 
 
 
 
 
 
 
86
  //Yoast WP SEO Tweals
87
  if( defined('WPSEO_VERSION') ){
88
  add_filter('wpseo_breadcrumb_links',array(self::$this_class,'wpseo_breadcrumb_links'));
83
  //sort out filters
84
  add_filter('wp_head', 'EM_Taxonomy_Frontend::remove_em_the_content', 10000);
85
  add_filter('the_content', array(self::$this_class,'the_content')); //come in slightly early and consider other plugins
86
+ // Meta Tag Manager Tweaks
87
+ if( defined('MTM_VERSION') ) {
88
+ add_filter('mtm_is_taxonomy_page', '__return_true');
89
+ add_filter('mtm_is_cpt_page', '__return_false');
90
+ add_filter('mtm_get_queried_object', function(){
91
+ global $em_the_query;
92
+ return $em_the_query->get_queried_object();
93
+ });
94
+ }
95
  //Yoast WP SEO Tweals
96
  if( defined('WPSEO_VERSION') ){
97
  add_filter('wpseo_breadcrumb_links',array(self::$this_class,'wpseo_breadcrumb_links'));
classes/em-ticket.php CHANGED
@@ -341,6 +341,7 @@ class EM_Ticket extends EM_Object{
341
  }
342
 
343
  function is_available( $ignore_member_restrictions = false, $ignore_guest_restrictions = false ){
 
344
  if( isset($this->is_available) && !$ignore_member_restrictions && !$ignore_guest_restrictions ) return apply_filters('em_ticket_is_available', $this->is_available, $this); //save extra queries if doing a standard check
345
  $is_available = false;
346
  $EM_Event = $this->get_event();
@@ -350,7 +351,7 @@ class EM_Ticket extends EM_Object{
350
  $condition_3 = $EM_Event->rsvp_end()->getTimestamp() > time(); //either defined ending rsvp time, or start datetime is used here
351
  $condition_4 = !$this->ticket_members || ($this->ticket_members && is_user_logged_in()) || $ignore_member_restrictions;
352
  $condition_5 = true;
353
- if( !$ignore_member_restrictions && !EM_Bookings::$disable_restrictions && $this->ticket_members && !empty($this->ticket_members_roles) ){
354
  //check if user has the right role to use this ticket
355
  $condition_5 = false;
356
  if( is_user_logged_in() ){
341
  }
342
 
343
  function is_available( $ignore_member_restrictions = false, $ignore_guest_restrictions = false ){
344
+ if( EM_Bookings::$disable_restrictions ) return true; // complete short-circuit
345
  if( isset($this->is_available) && !$ignore_member_restrictions && !$ignore_guest_restrictions ) return apply_filters('em_ticket_is_available', $this->is_available, $this); //save extra queries if doing a standard check
346
  $is_available = false;
347
  $EM_Event = $this->get_event();
351
  $condition_3 = $EM_Event->rsvp_end()->getTimestamp() > time(); //either defined ending rsvp time, or start datetime is used here
352
  $condition_4 = !$this->ticket_members || ($this->ticket_members && is_user_logged_in()) || $ignore_member_restrictions;
353
  $condition_5 = true;
354
+ if( !$ignore_member_restrictions && $this->ticket_members && !empty($this->ticket_members_roles) ){
355
  //check if user has the right role to use this ticket
356
  $condition_5 = false;
357
  if( is_user_logged_in() ){
classes/event-locations/em-event-location-url.php CHANGED
@@ -21,11 +21,11 @@ class URL extends Event_Location {
21
  if( !empty($_POST['event_location_url_text']) ){
22
  $this->data['text'] = sanitize_text_field($_POST['event_location_url_text']);
23
  }
24
- return $return;
25
  }
26
 
27
  public function validate(){
28
- $result = false;
29
  if( empty($this->data['url']) ){
30
  $this->event->add_error( __('Please enter a valid URL for this event location.', 'events-manager') );
31
  $result = false;
@@ -34,7 +34,7 @@ class URL extends Event_Location {
34
  $this->event->add_error( __('Please provide some link text for this event location URL.', 'events-manager') );
35
  $result = false;
36
  }
37
- return $result;
38
  }
39
 
40
  public function get_link( $new_target = true ){
21
  if( !empty($_POST['event_location_url_text']) ){
22
  $this->data['text'] = sanitize_text_field($_POST['event_location_url_text']);
23
  }
24
+ return apply_filters('em_event_location_url_get_post', $return, $this);
25
  }
26
 
27
  public function validate(){
28
+ $result = parent::validate();
29
  if( empty($this->data['url']) ){
30
  $this->event->add_error( __('Please enter a valid URL for this event location.', 'events-manager') );
31
  $result = false;
34
  $this->event->add_error( __('Please provide some link text for this event location URL.', 'events-manager') );
35
  $result = false;
36
  }
37
+ return apply_filters('em_event_location_url_validate', $result, $this);
38
  }
39
 
40
  public function get_link( $new_target = true ){
classes/event-locations/em-event-location.php CHANGED
@@ -103,6 +103,7 @@ class Event_Location {
103
  $this->data[$key] = maybe_unserialize($this->data[$key]);
104
  }
105
  }
 
106
  }
107
 
108
  /**
@@ -111,14 +112,14 @@ class Event_Location {
111
  */
112
  public function get_post(){
113
  $this->data = array();
114
- return true;
115
  }
116
 
117
  /**
118
  * @return boolean
119
  */
120
  public function validate(){
121
- return false;
122
  }
123
 
124
  public function save(){
@@ -133,13 +134,14 @@ class Event_Location {
133
  }
134
  }
135
  }
136
- return true;
137
  }
138
 
139
  public function delete(){
140
  $this->reset_data();
141
  $this->data = array();
142
- return true;
 
143
  }
144
 
145
  /**
103
  $this->data[$key] = maybe_unserialize($this->data[$key]);
104
  }
105
  }
106
+ do_action('em_event_location_load_postdata', $this);
107
  }
108
 
109
  /**
112
  */
113
  public function get_post(){
114
  $this->data = array();
115
+ return apply_filters('em_event_location_get_post', true, $this);
116
  }
117
 
118
  /**
119
  * @return boolean
120
  */
121
  public function validate(){
122
+ return apply_filters('em_event_location_validate', false, $this);
123
  }
124
 
125
  public function save(){
134
  }
135
  }
136
  }
137
+ return apply_filters('em_event_location_save', true, $this);
138
  }
139
 
140
  public function delete(){
141
  $this->reset_data();
142
  $this->data = array();
143
+ do_action('em_event_location_deleted', $this);
144
+ return apply_filters('em_event_location_delete', true, $this);
145
  }
146
 
147
  /**
em-functions.php CHANGED
@@ -615,20 +615,20 @@ function em_get_search_form_defaults($args = array()){
615
  //merge defaults with supplied arguments
616
  $args = array_merge($search_args, $args);
617
  //overwrite with $_REQUEST defaults in event of a submitted search
618
- if( isset($_REQUEST['geo']) ) $args['geo'] = $_REQUEST['geo']; //if geo search string requested, use that for search form
619
- if( isset($_REQUEST['near']) ) $args['near'] = wp_unslash($_REQUEST['near']); //if geo search string requested, use that for search form
620
- if( isset($_REQUEST['em_search']) ) $args['search'] = wp_unslash($_REQUEST['em_search']); //if geo search string requested, use that for search form
621
- if( isset($_REQUEST['category']) ) $args['category'] = $_REQUEST['category']; //if state requested, use that for searching
622
- if( isset($_REQUEST['country']) ) $args['country'] = wp_unslash($_REQUEST['country']); //if country requested, use that for searching
623
- if( isset($_REQUEST['region']) ) $args['region'] = wp_unslash($_REQUEST['region']); //if region requested, use that for searching
624
- if( isset($_REQUEST['state']) ) $args['state'] = wp_unslash($_REQUEST['state']); //if state requested, use that for searching
625
- if( isset($_REQUEST['town']) ) $args['town'] = wp_unslash($_REQUEST['town']); //if state requested, use that for searching
626
- if( isset($_REQUEST['near_unit']) ) $args['near_unit'] = $_REQUEST['near_unit']; //if state requested, use that for searching
627
- if( isset($_REQUEST['near_distance']) ) $args['near_distance'] = $_REQUEST['near_distance']; //if state requested, use that for searching
628
  if( !empty($_REQUEST['scope']) && !is_array($_REQUEST['scope'])){
629
- $args['scope'] = explode(',',$_REQUEST['scope']); //convert scope to an array in event of pagination
630
  }elseif( !empty($_REQUEST['scope']) ){
631
- $args['scope'] = $_REQUEST['scope'];
632
  }
633
  return $args;
634
  }
615
  //merge defaults with supplied arguments
616
  $args = array_merge($search_args, $args);
617
  //overwrite with $_REQUEST defaults in event of a submitted search
618
+ if( isset($_REQUEST['geo']) ) $args['geo'] = sanitize_text_field($_REQUEST['geo']); //if geo search string requested, use that for search form
619
+ if( isset($_REQUEST['near']) ) $args['near'] = sanitize_text_field(wp_unslash($_REQUEST['near'])); //if geo search string requested, use that for search form
620
+ if( isset($_REQUEST['em_search']) ) $args['search'] = sanitize_text_field(wp_unslash($_REQUEST['em_search'])); //if geo search string requested, use that for search form
621
+ if( isset($_REQUEST['category']) ) $args['category'] = sanitize_text_field($_REQUEST['category']); //if category requested, use that for searching
622
+ if( isset($_REQUEST['country']) ) $args['country'] = sanitize_text_field(wp_unslash($_REQUEST['country'])); //if country requested, use that for searching
623
+ if( isset($_REQUEST['region']) ) $args['region'] = sanitize_text_field(wp_unslash($_REQUEST['region'])); //if region requested, use that for searching
624
+ if( isset($_REQUEST['state']) ) $args['state'] = sanitize_text_field(wp_unslash($_REQUEST['state'])); //if state requested, use that for searching
625
+ if( isset($_REQUEST['town']) ) $args['town'] = sanitize_text_field(wp_unslash($_REQUEST['town'])); //if state requested, use that for searching
626
+ if( isset($_REQUEST['near_unit']) ) $args['near_unit'] = sanitize_text_field($_REQUEST['near_unit']); //if state requested, use that for searching
627
+ if( isset($_REQUEST['near_distance']) ) $args['near_distance'] = sanitize_text_field($_REQUEST['near_distance']); //if state requested, use that for searching
628
  if( !empty($_REQUEST['scope']) && !is_array($_REQUEST['scope'])){
629
+ $args['scope'] = explode(',',sanitize_text_field($_REQUEST['scope'])); //convert scope to an array in event of pagination
630
  }elseif( !empty($_REQUEST['scope']) ){
631
+ $args['scope'] = sanitize_text_field($_REQUEST['scope']);
632
  }
633
  return $args;
634
  }
events-manager.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
- Version: 5.11
5
  Plugin URI: http://wp-events-plugin.com
6
  Description: Event registration and booking management for WordPress. Recurring events, locations, webinars, google maps, rss, ical, booking registration and more!
7
  Author: Marcus Sykes
@@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
  */
29
 
30
  // Setting constants
31
- define('EM_VERSION', 5.99911); //self expanatory, although version currently may not correspond directly with published version number. until 6.0 we're stuck updating 5.999.x
32
  define('EM_PRO_MIN_VERSION', 2.6712); //self expanatory
33
  define('EM_PRO_MIN_VERSION_CRITICAL', 2.377); //self expanatory
34
  define('EM_DIR', dirname( __FILE__ )); //an absolute path to this directory
1
  <?php
2
  /*
3
  Plugin Name: Events Manager
4
+ Version: 5.12
5
  Plugin URI: http://wp-events-plugin.com
6
  Description: Event registration and booking management for WordPress. Recurring events, locations, webinars, google maps, rss, ical, booking registration and more!
7
  Author: Marcus Sykes
28
  */
29
 
30
  // Setting constants
31
+ define('EM_VERSION', 5.99912); //self expanatory, although version currently may not correspond directly with published version number. until 6.0 we're stuck updating 5.999.x
32
  define('EM_PRO_MIN_VERSION', 2.6712); //self expanatory
33
  define('EM_PRO_MIN_VERSION_CRITICAL', 2.377); //self expanatory
34
  define('EM_DIR', dirname( __FILE__ )); //an absolute path to this directory
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://wp-events-plugin.com
4
  Tags: bookings, calendar, tickets, events, buddypress, event management, google maps, maps, locations, registration, zoom
5
  Text Domain: events-manager
6
  Requires at least: 5.2
7
- Tested up to: 5.8
8
- Stable tag: 5.11
9
  Requires PHP: 5.3
10
 
11
  Fully featured event registration management including recurring events, locations management, calendar, Google map integration, booking management
@@ -119,6 +119,14 @@ See our [FAQ](http://wp-events-plugin.com/documentation/faq/) page, which is upd
119
  6. Manage attendees with various booking reports
120
 
121
  == Changelog ==
 
 
 
 
 
 
 
 
122
  = 5.11 =
123
  * fixed booking-related php errors deriving from accessing $EM_Booking->people directly since 5.10
124
  * added 'week', 'this-week' and 'this-month' scopes
4
  Tags: bookings, calendar, tickets, events, buddypress, event management, google maps, maps, locations, registration, zoom
5
  Text Domain: events-manager
6
  Requires at least: 5.2
7
+ Tested up to: 5.8.1
8
+ Stable tag: 5.12
9
  Requires PHP: 5.3
10
 
11
  Fully featured event registration management including recurring events, locations management, calendar, Google map integration, booking management
119
  6. Manage attendees with various booking reports
120
 
121
  == Changelog ==
122
+ = 5.12 =
123
+ * changed EM_Booking::$disable_restricions so that all ticket restrictions can ignored for admin manual bookings (pro feature) including spaces, roles and dates
124
+ * added taxonomy filters for Meta Tag Manager compatibility on overriden taxonomy pages
125
+ * added filters to Event_Locations\Event_Location and Event_Locations\URL
126
+ * added filters to EM_Events::output_grouped()
127
+ * fixed #_EVENTDATES_LOCAL and #_24HHTIMES_LOCAL showing time/date range even if time/dates are the same
128
+ * fixed XSS security vulnerability reported by/via WP Plugins team
129
+
130
  = 5.11 =
131
  * fixed booking-related php errors deriving from accessing $EM_Booking->people directly since 5.10
132
  * added 'week', 'this-week' and 'this-month' scopes
templates/forms/event/attributes-public.php CHANGED
@@ -11,19 +11,19 @@ $has_deprecated = false;
11
  <?php if( count( $attributes['names'] ) > 0 ) : ?>
12
  <?php foreach( $attributes['names'] as $name) : ?>
13
  <div class="event-attributes">
14
- <label for="em_attributes[<?php echo $name ?>]"><?php echo $name ?></label>
15
  <?php if( count($attributes['values'][$name]) > 1 ): ?>
16
- <select name="em_attributes[<?php echo $name ?>]">
17
  <?php foreach($attributes['values'][$name] as $attribute_val): ?>
18
  <?php if( is_array($EM_Event->event_attributes) && array_key_exists($name, $EM_Event->event_attributes) && $EM_Event->event_attributes[$name]==$attribute_val ): ?>
19
- <option selected="selected"><?php echo $attribute_val; ?></option>
20
  <?php else: ?>
21
- <option><?php echo $attribute_val; ?></option>
22
  <?php endif; ?>
23
  <?php endforeach; ?>
24
  </select>
25
  <?php else: ?>
26
- <input type="text" name="em_attributes[<?php echo $name ?>]" value="<?php echo array_key_exists($name, $EM_Event->event_attributes) ? esc_attr($EM_Event->event_attributes[$name], ENT_QUOTES):''; ?>" />
27
  <?php endif; ?>
28
  </div>
29
  <?php endforeach; ?>
11
  <?php if( count( $attributes['names'] ) > 0 ) : ?>
12
  <?php foreach( $attributes['names'] as $name) : ?>
13
  <div class="event-attributes">
14
+ <label for="em_attributes[<?php echo esc_attr($name) ?>]"><?php echo esc_html($name) ?></label>
15
  <?php if( count($attributes['values'][$name]) > 1 ): ?>
16
+ <select name="em_attributes[<?php echo esc_html($name) ?>]">
17
  <?php foreach($attributes['values'][$name] as $attribute_val): ?>
18
  <?php if( is_array($EM_Event->event_attributes) && array_key_exists($name, $EM_Event->event_attributes) && $EM_Event->event_attributes[$name]==$attribute_val ): ?>
19
+ <option selected="selected"><?php echo esc_html($attribute_val); ?></option>
20
  <?php else: ?>
21
+ <option><?php echo esc_html($attribute_val); ?></option>
22
  <?php endif; ?>
23
  <?php endforeach; ?>
24
  </select>
25
  <?php else: ?>
26
+ <input type="text" name="em_attributes[<?php echo esc_attr($name) ?>]" value="<?php echo array_key_exists($name, $EM_Event->event_attributes) ? esc_attr($EM_Event->event_attributes[$name]):''; ?>" />
27
  <?php endif; ?>
28
  </div>
29
  <?php endforeach; ?>
templates/forms/location/attributes-public.php CHANGED
@@ -11,19 +11,19 @@ $has_deprecated = false;
11
  <?php if( count( $attributes['names'] ) > 0 ) : ?>
12
  <?php foreach( $attributes['names'] as $name) : ?>
13
  <div class="location-attributes">
14
- <label for="em_attributes[<?php echo $name ?>]"><?php echo $name ?></label>
15
  <?php if( count($attributes['values'][$name]) > 1 ): ?>
16
- <select name="em_attributes[<?php echo $name ?>]">
17
  <?php foreach($attributes['values'][$name] as $attribute_val): ?>
18
  <?php if( is_array($EM_Location->location_attributes) && array_key_exists($name, $EM_Location->location_attributes) && $EM_Location->location_attributes[$name]==$attribute_val ): ?>
19
- <option selected="selected"><?php echo $attribute_val; ?></option>
20
  <?php else: ?>
21
- <option><?php echo $attribute_val; ?></option>
22
  <?php endif; ?>
23
  <?php endforeach; ?>
24
  </select>
25
  <?php else: ?>
26
- <input type="text" name="em_attributes[<?php echo $name ?>]" value="<?php echo array_key_exists($name, $EM_Location->location_attributes) ? esc_attr($EM_Location->location_attributes[$name], ENT_QUOTES):''; ?>" />
27
  <?php endif; ?>
28
  </div>
29
  <?php endforeach; ?>
11
  <?php if( count( $attributes['names'] ) > 0 ) : ?>
12
  <?php foreach( $attributes['names'] as $name) : ?>
13
  <div class="location-attributes">
14
+ <label for="em_attributes[<?php echo esc_attr($name) ?>]"><?php echo esc_html($name); ?></label>
15
  <?php if( count($attributes['values'][$name]) > 1 ): ?>
16
+ <select name="em_attributes[<?php echo esc_attr($name); ?>]">
17
  <?php foreach($attributes['values'][$name] as $attribute_val): ?>
18
  <?php if( is_array($EM_Location->location_attributes) && array_key_exists($name, $EM_Location->location_attributes) && $EM_Location->location_attributes[$name]==$attribute_val ): ?>
19
+ <option selected="selected"><?php echo esc_html($attribute_val); ?></option>
20
  <?php else: ?>
21
+ <option><?php echo esc_html($attribute_val); ?></option>
22
  <?php endif; ?>
23
  <?php endforeach; ?>
24
  </select>
25
  <?php else: ?>
26
+ <input type="text" name="em_attributes[<?php echo esc_attr($name) ?>]" value="<?php echo array_key_exists($name, $EM_Location->location_attributes) ? esc_attr($EM_Location->location_attributes[$name], ENT_QUOTES):''; ?>" />
27
  <?php endif; ?>
28
  </div>
29
  <?php endforeach; ?>
templates/templates/events-search.php CHANGED
@@ -60,8 +60,8 @@ $args = !empty($args) ? $args:array(); /* @var $args array */
60
  <input type="hidden" name="country" value="<?php echo esc_attr($args['country']) ?>" />
61
  <?php endif; ?>
62
  <?php if( empty($args['show_advanced']) || empty($args['search_geo_units']) ): //show country in hidden field for geo searching ?>
63
- <?php if( !empty($args['near_distance']) ) : ?><input name="near_distance" type="hidden" value="<?php echo $args['near_distance']; ?>" /><?php endif; ?>
64
- <?php if( !empty($args['near_unit']) ) : ?><input name="near_unit" type="hidden" value="<?php echo $args['near_unit']; ?>" /><?php endif; ?>
65
  <?php endif; ?>
66
  </form>
67
  </div>
60
  <input type="hidden" name="country" value="<?php echo esc_attr($args['country']) ?>" />
61
  <?php endif; ?>
62
  <?php if( empty($args['show_advanced']) || empty($args['search_geo_units']) ): //show country in hidden field for geo searching ?>
63
+ <?php if( !empty($args['near_distance']) ) : ?><input name="near_distance" type="hidden" value="<?php echo esc_attr($args['near_distance']); ?>" /><?php endif; ?>
64
+ <?php if( !empty($args['near_unit']) ) : ?><input name="near_unit" type="hidden" value="<?php echo esc_attr($args['near_unit']); ?>" /><?php endif; ?>
65
  <?php endif; ?>
66
  </form>
67
  </div>
templates/templates/search/geo-units.php CHANGED
@@ -5,7 +5,7 @@
5
  <span><?php echo esc_html($args['geo_units_label']); ?></span>
6
  <select name="near_distance" class="em-search-geo-distance">
7
  <?php foreach( $args['geo_distance_values'] as $unit ) : ?>
8
- <option value="<?php echo $unit; ?>" <?php if($args['near_distance'] == $unit) echo 'selected="selected"' ?>><?php echo $unit; ?></option>
9
  <?php endforeach; ?>
10
  </select>
11
  </label>
5
  <span><?php echo esc_html($args['geo_units_label']); ?></span>
6
  <select name="near_distance" class="em-search-geo-distance">
7
  <?php foreach( $args['geo_distance_values'] as $unit ) : ?>
8
+ <option value="<?php echo esc_attr($unit); ?>" <?php if($args['near_distance'] == $unit) echo 'selected="selected"' ?>><?php echo esc_html($unit); ?></option>
9
  <?php endforeach; ?>
10
  </select>
11
  </label>