@@ -210,14 +210,14 @@ discard block |
||
| 210 | 210 | <?php _e('Show on all Pages:', 'event_espresso'); ?> |
| 211 | 211 | </label> |
| 212 | 212 | <?php |
| 213 | - echo EEH_Form_Fields::select( |
|
| 214 | - __('Show on all Pages:', 'event_espresso'), |
|
| 215 | - $instance['show_everywhere'], |
|
| 216 | - $yes_no_values, |
|
| 217 | - $this->get_field_name('show_everywhere'), |
|
| 218 | - $this->get_field_id('show_everywhere') |
|
| 219 | - ); |
|
| 220 | - ?> |
|
| 213 | + echo EEH_Form_Fields::select( |
|
| 214 | + __('Show on all Pages:', 'event_espresso'), |
|
| 215 | + $instance['show_everywhere'], |
|
| 216 | + $yes_no_values, |
|
| 217 | + $this->get_field_name('show_everywhere'), |
|
| 218 | + $this->get_field_id('show_everywhere') |
|
| 219 | + ); |
|
| 220 | + ?> |
|
| 221 | 221 | </p> |
| 222 | 222 | <p> |
| 223 | 223 | <label for="<?php echo $this->get_field_id('date_limit'); ?>"> |
@@ -300,14 +300,14 @@ discard block |
||
| 300 | 300 | extract($args); |
| 301 | 301 | |
| 302 | 302 | // add function to make the title a link |
| 303 | - add_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
| 303 | + add_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
| 304 | 304 | |
| 305 | 305 | $title = isset( $instance['title'] ) && ! empty( $instance['title'] ) ? $instance['title'] : ''; |
| 306 | 306 | // filter the title |
| 307 | 307 | $title = apply_filters('widget_title', $title); |
| 308 | 308 | |
| 309 | 309 | // remove the function from the filter, so it does not affect other widgets |
| 310 | - remove_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
| 310 | + remove_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
| 311 | 311 | |
| 312 | 312 | // Before widget (defined by themes). |
| 313 | 313 | echo $before_widget; |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | * @return string |
| 420 | 420 | */ |
| 421 | 421 | public function make_the_title_a_link($title) { |
| 422 | - return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
| 422 | + return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | } |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function __construct() { |
| 33 | 33 | parent::__construct( |
| 34 | - __( 'Event Espresso Upcoming Events', 'event_espresso' ), |
|
| 35 | - array( 'description' => __( 'A widget to display your upcoming events.', 'event_espresso' )) |
|
| 34 | + __('Event Espresso Upcoming Events', 'event_espresso'), |
|
| 35 | + array('description' => __('A widget to display your upcoming events.', 'event_espresso')) |
|
| 36 | 36 | ); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | * @param array $instance Previously saved values from database. |
| 46 | 46 | * @return string|void |
| 47 | 47 | */ |
| 48 | - public function form( $instance ) { |
|
| 48 | + public function form($instance) { |
|
| 49 | 49 | |
| 50 | - EE_Registry::instance()->load_class( 'Question_Option', array(), FALSE, FALSE, TRUE ); |
|
| 50 | + EE_Registry::instance()->load_class('Question_Option', array(), FALSE, FALSE, TRUE); |
|
| 51 | 51 | // Set up some default widget settings. |
| 52 | 52 | $defaults = array( |
| 53 | 53 | 'title' => __('Upcoming Events', 'event_espresso'), |
@@ -63,16 +63,16 @@ discard block |
||
| 63 | 63 | 'image_size' => 'medium' |
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | - $instance = wp_parse_args( (array) $instance, $defaults ); |
|
| 66 | + $instance = wp_parse_args((array) $instance, $defaults); |
|
| 67 | 67 | // don't add HTML labels for EE_Form_Fields generated inputs |
| 68 | - add_filter( 'FHEE__EEH_Form_Fields__label_html', '__return_empty_string' ); |
|
| 68 | + add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string'); |
|
| 69 | 69 | $yes_no_values = array( |
| 70 | - EE_Question_Option::new_instance( array( 'QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))), |
|
| 71 | - EE_Question_Option::new_instance( array( 'QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso'))) |
|
| 70 | + EE_Question_Option::new_instance(array('QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))), |
|
| 71 | + EE_Question_Option::new_instance(array('QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso'))) |
|
| 72 | 72 | ); |
| 73 | 73 | $sort_values = array( |
| 74 | - EE_Question_Option::new_instance( array( 'QSO_value' => 'ASC', 'QSO_desc' => __('ASC', 'event_espresso'))), |
|
| 75 | - EE_Question_Option::new_instance( array( 'QSO_value' => 'DESC', 'QSO_desc' => __('DESC', 'event_espresso'))) |
|
| 74 | + EE_Question_Option::new_instance(array('QSO_value' => 'ASC', 'QSO_desc' => __('ASC', 'event_espresso'))), |
|
| 75 | + EE_Question_Option::new_instance(array('QSO_value' => 'DESC', 'QSO_desc' => __('DESC', 'event_espresso'))) |
|
| 76 | 76 | ); |
| 77 | 77 | |
| 78 | 78 | ?> |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | <label for="<?php echo $this->get_field_id('title'); ?>"> |
| 84 | 84 | <?php _e('Title:', 'event_espresso'); ?> |
| 85 | 85 | </label> |
| 86 | - <input id="<?php echo $this->get_field_id('title'); ?>" class="widefat" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" type="text" /> |
|
| 86 | + <input id="<?php echo $this->get_field_id('title'); ?>" class="widefat" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr($instance['title']); ?>" type="text" /> |
|
| 87 | 87 | </p> |
| 88 | 88 | <p> |
| 89 | 89 | <label for="<?php echo $this->get_field_id('category_name'); ?>"> |
@@ -92,16 +92,16 @@ discard block |
||
| 92 | 92 | <?php |
| 93 | 93 | $event_categories = array(); |
| 94 | 94 | /** @type EEM_Term $EEM_Term */ |
| 95 | - $EEM_Term = EE_Registry::instance()->load_model( 'Term' ); |
|
| 96 | - $categories = $EEM_Term->get_all_ee_categories( TRUE ); |
|
| 97 | - if ( $categories ) { |
|
| 98 | - foreach ( $categories as $category ) { |
|
| 99 | - if ( $category instanceof EE_Term ) { |
|
| 100 | - $event_categories[] = EE_Question_Option::new_instance( array( 'QSO_value' => $category->get( 'slug' ), 'QSO_desc' => $category->get( 'name' ))); |
|
| 95 | + $EEM_Term = EE_Registry::instance()->load_model('Term'); |
|
| 96 | + $categories = $EEM_Term->get_all_ee_categories(TRUE); |
|
| 97 | + if ($categories) { |
|
| 98 | + foreach ($categories as $category) { |
|
| 99 | + if ($category instanceof EE_Term) { |
|
| 100 | + $event_categories[] = EE_Question_Option::new_instance(array('QSO_value' => $category->get('slug'), 'QSO_desc' => $category->get('name'))); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | - array_unshift( $event_categories, EE_Question_Option::new_instance( array( 'QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso')))); |
|
| 104 | + array_unshift($event_categories, EE_Question_Option::new_instance(array('QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso')))); |
|
| 105 | 105 | echo EEH_Form_Fields::select( |
| 106 | 106 | __('Event Category:', 'event_espresso'), |
| 107 | 107 | $instance['category_name'], |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | __('Show Expired Events:', 'event_espresso'), |
| 127 | 127 | $instance['show_expired'], |
| 128 | 128 | array( |
| 129 | - EE_Question_Option::new_instance( array( 'QSO_value' => 0, 'QSO_desc' => __('No', 'event_espresso'))), |
|
| 130 | - EE_Question_Option::new_instance( array( 'QSO_value' => 1, 'QSO_desc' => __('Yes', 'event_espresso'))), |
|
| 131 | - EE_Question_Option::new_instance( array( 'QSO_value' => 2, 'QSO_desc' => __('Show Only Expired', 'event_espresso'))), |
|
| 129 | + EE_Question_Option::new_instance(array('QSO_value' => 0, 'QSO_desc' => __('No', 'event_espresso'))), |
|
| 130 | + EE_Question_Option::new_instance(array('QSO_value' => 1, 'QSO_desc' => __('Yes', 'event_espresso'))), |
|
| 131 | + EE_Question_Option::new_instance(array('QSO_value' => 2, 'QSO_desc' => __('Show Only Expired', 'event_espresso'))), |
|
| 132 | 132 | ), |
| 133 | 133 | $this->get_field_name('show_expired'), |
| 134 | 134 | $this->get_field_id('show_expired') |
@@ -156,16 +156,16 @@ discard block |
||
| 156 | 156 | <?php |
| 157 | 157 | $image_sizes = array(); |
| 158 | 158 | $sizes = get_intermediate_image_sizes(); |
| 159 | - if ( $sizes ) { |
|
| 159 | + if ($sizes) { |
|
| 160 | 160 | // loop thru images and create option objects out of them |
| 161 | - foreach ( $sizes as $image_size ) { |
|
| 162 | - $image_size = trim( $image_size ); |
|
| 161 | + foreach ($sizes as $image_size) { |
|
| 162 | + $image_size = trim($image_size); |
|
| 163 | 163 | // no big images plz |
| 164 | - if ( ! in_array( $image_size, array( 'large', 'post-thumbnail' ))) { |
|
| 165 | - $image_sizes[] = EE_Question_Option::new_instance( array( 'QSO_value' => $image_size, 'QSO_desc' => $image_size )); |
|
| 164 | + if ( ! in_array($image_size, array('large', 'post-thumbnail'))) { |
|
| 165 | + $image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => $image_size, 'QSO_desc' => $image_size)); |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | - $image_sizes[] = EE_Question_Option::new_instance( array( 'QSO_value' => 'none', 'QSO_desc' => __('don\'t show images', 'event_espresso') )); |
|
| 168 | + $image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => 'none', 'QSO_desc' => __('don\'t show images', 'event_espresso'))); |
|
| 169 | 169 | } |
| 170 | 170 | echo EEH_Form_Fields::select( |
| 171 | 171 | __('Image Size:', 'event_espresso'), |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | <label for="<?php echo $this->get_field_id('date_limit'); ?>"> |
| 224 | 224 | <?php _e('Number of Dates to Display:', 'event_espresso'); ?> |
| 225 | 225 | </label> |
| 226 | - <input id="<?php echo $this->get_field_id('date_limit'); ?>" name="<?php echo $this->get_field_name('date_limit'); ?>" value="<?php echo esc_attr( $instance['date_limit'] ); ?>" size="3" type="text" /> |
|
| 226 | + <input id="<?php echo $this->get_field_id('date_limit'); ?>" name="<?php echo $this->get_field_name('date_limit'); ?>" value="<?php echo esc_attr($instance['date_limit']); ?>" size="3" type="text" /> |
|
| 227 | 227 | </p> |
| 228 | 228 | <p> |
| 229 | 229 | <label for="<?php echo $this->get_field_id('date_range'); ?>"> |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | * |
| 256 | 256 | * @return array Updated safe values to be saved. |
| 257 | 257 | */ |
| 258 | - public function update( $new_instance, $old_instance ) { |
|
| 258 | + public function update($new_instance, $old_instance) { |
|
| 259 | 259 | $instance = $old_instance; |
| 260 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
| 260 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
| 261 | 261 | $instance['category_name'] = $new_instance['category_name']; |
| 262 | 262 | $instance['show_expired'] = $new_instance['show_expired']; |
| 263 | 263 | $instance['limit'] = $new_instance['limit']; |
@@ -281,18 +281,18 @@ discard block |
||
| 281 | 281 | * @param array $args Widget arguments. |
| 282 | 282 | * @param array $instance Saved values from database. |
| 283 | 283 | */ |
| 284 | - public function widget( $args, $instance ) { |
|
| 284 | + public function widget($args, $instance) { |
|
| 285 | 285 | |
| 286 | 286 | global $post; |
| 287 | 287 | // make sure there is some kinda post object |
| 288 | - if ( $post instanceof WP_Post ) { |
|
| 288 | + if ($post instanceof WP_Post) { |
|
| 289 | 289 | $before_widget = ''; |
| 290 | 290 | $before_title = ''; |
| 291 | 291 | $after_title = ''; |
| 292 | 292 | $after_widget = ''; |
| 293 | 293 | // but NOT an events archives page, cuz that would be like two event lists on the same page |
| 294 | - $show_everywhere = isset( $instance['show_everywhere'] ) ? (bool) absint( $instance['show_everywhere'] ) : TRUE; |
|
| 295 | - if ( $show_everywhere || ! ( $post->post_type == 'espresso_events' && is_archive() )) { |
|
| 294 | + $show_everywhere = isset($instance['show_everywhere']) ? (bool) absint($instance['show_everywhere']) : TRUE; |
|
| 295 | + if ($show_everywhere || ! ($post->post_type == 'espresso_events' && is_archive())) { |
|
| 296 | 296 | // let's use some of the event helper functions' |
| 297 | 297 | // make separate vars out of attributes |
| 298 | 298 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | // add function to make the title a link |
| 303 | 303 | add_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
| 304 | 304 | |
| 305 | - $title = isset( $instance['title'] ) && ! empty( $instance['title'] ) ? $instance['title'] : ''; |
|
| 305 | + $title = isset($instance['title']) && ! empty($instance['title']) ? $instance['title'] : ''; |
|
| 306 | 306 | // filter the title |
| 307 | 307 | $title = apply_filters('widget_title', $title); |
| 308 | 308 | |
@@ -312,90 +312,90 @@ discard block |
||
| 312 | 312 | // Before widget (defined by themes). |
| 313 | 313 | echo $before_widget; |
| 314 | 314 | // Display the widget title if one was input (before and after defined by themes). |
| 315 | - if ( ! empty( $title )) { |
|
| 316 | - echo $before_title . $title . $after_title; |
|
| 315 | + if ( ! empty($title)) { |
|
| 316 | + echo $before_title.$title.$after_title; |
|
| 317 | 317 | } |
| 318 | 318 | // grab widget settings |
| 319 | - $category = isset( $instance['category_name'] ) && ! empty( $instance['category_name'] ) ? $instance['category_name'] : FALSE; |
|
| 320 | - $show_expired = isset( $instance['show_expired'] ) ? absint( $instance['show_expired'] ) : 0; |
|
| 321 | - $image_size = isset( $instance['image_size'] ) && ! empty( $instance['image_size'] ) ? $instance['image_size'] : 'medium'; |
|
| 322 | - $show_desc = isset( $instance['show_desc'] ) ? (bool) absint( $instance['show_desc'] ) : TRUE; |
|
| 323 | - $show_dates = isset( $instance['show_dates'] ) ? (bool) absint( $instance['show_dates'] ) : TRUE; |
|
| 324 | - $date_limit = isset( $instance['date_limit'] ) && ! empty( $instance['date_limit'] ) ? $instance['date_limit'] : NULL; |
|
| 325 | - $date_range = isset( $instance['date_range'] ) && ! empty( $instance['date_range'] ) ? $instance['date_range'] : FALSE; |
|
| 319 | + $category = isset($instance['category_name']) && ! empty($instance['category_name']) ? $instance['category_name'] : FALSE; |
|
| 320 | + $show_expired = isset($instance['show_expired']) ? absint($instance['show_expired']) : 0; |
|
| 321 | + $image_size = isset($instance['image_size']) && ! empty($instance['image_size']) ? $instance['image_size'] : 'medium'; |
|
| 322 | + $show_desc = isset($instance['show_desc']) ? (bool) absint($instance['show_desc']) : TRUE; |
|
| 323 | + $show_dates = isset($instance['show_dates']) ? (bool) absint($instance['show_dates']) : TRUE; |
|
| 324 | + $date_limit = isset($instance['date_limit']) && ! empty($instance['date_limit']) ? $instance['date_limit'] : NULL; |
|
| 325 | + $date_range = isset($instance['date_range']) && ! empty($instance['date_range']) ? $instance['date_range'] : FALSE; |
|
| 326 | 326 | // start to build our where clause |
| 327 | 327 | $where = array( |
| 328 | 328 | // 'Datetime.DTT_is_primary' => 1, |
| 329 | - 'status' => array( 'IN', array( 'publish', 'sold_out' ) ) |
|
| 329 | + 'status' => array('IN', array('publish', 'sold_out')) |
|
| 330 | 330 | ); |
| 331 | 331 | // add category |
| 332 | - if ( $category ) { |
|
| 332 | + if ($category) { |
|
| 333 | 333 | $where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories'; |
| 334 | 334 | $where['Term_Taxonomy.Term.slug'] = $category; |
| 335 | 335 | } |
| 336 | 336 | // if NOT expired then we want events that start today or in the future |
| 337 | 337 | // if NOT show expired then we want events that start today or in the future |
| 338 | - if ( $show_expired == 0 ) { |
|
| 339 | - $where['Datetime.DTT_EVT_end'] = array( '>=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_end' ) ); |
|
| 338 | + if ($show_expired == 0) { |
|
| 339 | + $where['Datetime.DTT_EVT_end'] = array('>=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end')); |
|
| 340 | 340 | } |
| 341 | 341 | // if show ONLY expired we want events that ended prior to today |
| 342 | - if ( $show_expired == 2 ) { |
|
| 343 | - $where['Datetime.DTT_EVT_end'] = array( '<=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_start' ) ); |
|
| 342 | + if ($show_expired == 2) { |
|
| 343 | + $where['Datetime.DTT_EVT_end'] = array('<=', EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start')); |
|
| 344 | 344 | } |
| 345 | 345 | // allow $where to be filtered |
| 346 | - $where = apply_filters( 'FHEE__EEW_Upcoming_Events__widget__where', $where, $category, $show_expired ); |
|
| 346 | + $where = apply_filters('FHEE__EEW_Upcoming_Events__widget__where', $where, $category, $show_expired); |
|
| 347 | 347 | // run the query |
| 348 | - $events = EE_Registry::instance()->load_model( 'Event' )->get_all( array( |
|
| 348 | + $events = EE_Registry::instance()->load_model('Event')->get_all(array( |
|
| 349 | 349 | $where, |
| 350 | 350 | 'limit' => isset($instance['limit']) && $instance['limit'] > 0 |
| 351 | - ? '0,' . $instance['limit'] |
|
| 351 | + ? '0,'.$instance['limit'] |
|
| 352 | 352 | : '0,10', |
| 353 | 353 | 'order_by' => 'Datetime.DTT_EVT_start', |
| 354 | 354 | 'order' => isset($instance['sort']) ? $instance['sort'] : 'ASC', |
| 355 | 355 | 'group_by' => 'EVT_ID' |
| 356 | 356 | )); |
| 357 | 357 | |
| 358 | - if ( ! empty( $events )) { |
|
| 358 | + if ( ! empty($events)) { |
|
| 359 | 359 | echo '<ul class="ee-upcoming-events-widget-ul">'; |
| 360 | - foreach ( $events as $event ) { |
|
| 361 | - if ( $event instanceof EE_Event && ( !is_single() || $post->ID != $event->ID() ) ) { |
|
| 360 | + foreach ($events as $event) { |
|
| 361 | + if ($event instanceof EE_Event && ( ! is_single() || $post->ID != $event->ID())) { |
|
| 362 | 362 | //printr( $event, '$event <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
| 363 | - echo '<li id="ee-upcoming-events-widget-li-' . $event->ID() . '" class="ee-upcoming-events-widget-li">'; |
|
| 363 | + echo '<li id="ee-upcoming-events-widget-li-'.$event->ID().'" class="ee-upcoming-events-widget-li">'; |
|
| 364 | 364 | // how big is the event name ? |
| 365 | - $name_length = strlen( $event->name() ); |
|
| 366 | - switch( $name_length ) { |
|
| 365 | + $name_length = strlen($event->name()); |
|
| 366 | + switch ($name_length) { |
|
| 367 | 367 | case $name_length > 70 : |
| 368 | - $len_class = ' three-line'; |
|
| 368 | + $len_class = ' three-line'; |
|
| 369 | 369 | break; |
| 370 | 370 | case $name_length > 35 : |
| 371 | - $len_class = ' two-line'; |
|
| 371 | + $len_class = ' two-line'; |
|
| 372 | 372 | break; |
| 373 | 373 | default : |
| 374 | - $len_class = ' one-line'; |
|
| 374 | + $len_class = ' one-line'; |
|
| 375 | 375 | } |
| 376 | - $event_url = apply_filters( 'FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event ); |
|
| 377 | - echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a' . $len_class . '" href="' . $event_url . '">' . $event->name() . '</a></h5>'; |
|
| 378 | - if ( post_password_required( $event->ID() ) ) { |
|
| 379 | - $pswd_form = apply_filters( 'FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form( $event->ID() ), $event ); |
|
| 376 | + $event_url = apply_filters('FHEE_EEW_Upcoming_Events__widget__event_url', $event->get_permalink(), $event); |
|
| 377 | + echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a'.$len_class.'" href="'.$event_url.'">'.$event->name().'</a></h5>'; |
|
| 378 | + if (post_password_required($event->ID())) { |
|
| 379 | + $pswd_form = apply_filters('FHEE_EEW_Upcoming_Events__widget__password_form', get_the_password_form($event->ID()), $event); |
|
| 380 | 380 | echo $pswd_form; |
| 381 | 381 | } else { |
| 382 | - if ( has_post_thumbnail( $event->ID() ) && $image_size != 'none' ) { |
|
| 383 | - echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="' . $event_url . '">' . get_the_post_thumbnail( $event->ID(), $image_size ) . '</a></div>'; |
|
| 382 | + if (has_post_thumbnail($event->ID()) && $image_size != 'none') { |
|
| 383 | + echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="'.$event_url.'">'.get_the_post_thumbnail($event->ID(), $image_size).'</a></div>'; |
|
| 384 | 384 | } |
| 385 | - $desc = $event->short_description( 25 ); |
|
| 386 | - if ( $show_dates ) { |
|
| 387 | - $date_format = apply_filters( 'FHEE__espresso_event_date_range__date_format', get_option( 'date_format' )); |
|
| 388 | - $time_format = apply_filters( 'FHEE__espresso_event_date_range__time_format', get_option( 'time_format' )); |
|
| 389 | - $single_date_format = apply_filters( 'FHEE__espresso_event_date_range__single_date_format', get_option( 'date_format' )); |
|
| 390 | - $single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', get_option( 'time_format' )); |
|
| 391 | - if ( $date_range == TRUE ) { |
|
| 392 | - echo espresso_event_date_range( $date_format, $time_format, $single_date_format, $single_time_format, $event->ID() ); |
|
| 393 | - }else{ |
|
| 394 | - echo espresso_list_of_event_dates( $event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit ); |
|
| 385 | + $desc = $event->short_description(25); |
|
| 386 | + if ($show_dates) { |
|
| 387 | + $date_format = apply_filters('FHEE__espresso_event_date_range__date_format', get_option('date_format')); |
|
| 388 | + $time_format = apply_filters('FHEE__espresso_event_date_range__time_format', get_option('time_format')); |
|
| 389 | + $single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', get_option('date_format')); |
|
| 390 | + $single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', get_option('time_format')); |
|
| 391 | + if ($date_range == TRUE) { |
|
| 392 | + echo espresso_event_date_range($date_format, $time_format, $single_date_format, $single_time_format, $event->ID()); |
|
| 393 | + } else { |
|
| 394 | + echo espresso_list_of_event_dates($event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit); |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | - if ( $show_desc && $desc ) { |
|
| 398 | - echo '<p style="margin-top: .5em">' . $desc . '</p>'; |
|
| 397 | + if ($show_desc && $desc) { |
|
| 398 | + echo '<p style="margin-top: .5em">'.$desc.'</p>'; |
|
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | echo '</li>'; |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | * @return string |
| 420 | 420 | */ |
| 421 | 421 | public function make_the_title_a_link($title) { |
| 422 | - return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
| 422 | + return '<a href="'.EEH_Event_View::event_archive_url().'">'.$title.'</a>'; |
|
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | } |