Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. <?php
  2. /**
  3. * Single Event Template for Widgets
  4. *
  5. * This template is used to render single events for both the calendar and advanced
  6. * list widgets, facilitating a common appearance for each as standard.
  7. *
  8. * You can override this template in your own theme by creating a file at
  9. * [your-theme]/tribe-events/pro/widgets/modules/single-event.php
  10. *
  11. * @package TribeEventsCalendarPro
  12. *
  13. */
  14. $mini_cal_event_atts = tribe_events_get_widget_event_atts();
  15. $postDate = tribe_events_get_widget_event_post_date();
  16. $organizer_ids = tribe_get_organizer_ids();
  17. $multiple_organizers = count( $organizer_ids ) > 1;
  18. ?>
  19.  
  20. <div class="tribe-mini-calendar-event event-<?php esc_attr_e( $mini_cal_event_atts['current_post'] ); ?> <?php esc_attr_e( $mini_cal_event_atts['class'] ); ?>">
  21. <div class="list-date">
  22. <span
  23. class="list-dayname"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'D', $postDate ), $postDate, $mini_cal_event_atts['class'] ); ?></span>
  24. <span
  25. class="list-daynumber"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_daynumber', date_i18n( 'd', $postDate ), $postDate, $mini_cal_event_atts['class'] ); ?></span>
  26. </div>
  27.  
  28. <div class="list-info">
  29. <?php do_action( 'tribe_events_list_widget_before_the_event_title' ); ?>
  30.  
  31. <h2 class="tribe-events-title">
  32. <a href="<?php echo esc_url( tribe_get_event_link() ); ?>" rel="bookmark"><?php the_title(); ?></a>
  33. </h2>
  34.  
  35. <?php do_action( 'tribe_events_list_widget_after_the_event_title' ); ?>
  36.  
  37. <?php do_action( 'tribe_events_list_widget_before_the_meta' ) ?>
  38.  
  39. <?php echo tribe_event_featured_image( null, 'thumbnail' ); ?>
  40.  
  41. <div class="tribe-events-duration">
  42. <?php echo tribe_events_event_schedule_details(); ?>
  43. </div>
  44.  
  45. <?php if ( isset( $cost ) && $cost && tribe_get_cost() != '' ) : ?>
  46. <span class="tribe-events-divider">|</span>
  47. <div class="tribe-events-event-cost">
  48. <?php echo tribe_get_cost( null, true ); ?>
  49. </div>
  50. <?php endif ?>
  51.  
  52. <div class="tribe-events-location">
  53.  
  54. <?php if ( isset( $venue ) && $venue && tribe_get_venue() != '' ): ?>
  55. <span class="tribe-events-venue"><?php echo tribe_get_venue_link(); ?></span>
  56. <?php endif ?>
  57.  
  58. <?php if ( isset( $address ) && $address && tribe_get_address() != '' ): ?>
  59. <span class="tribe-street-address"><?php echo tribe_get_address(); ?></span>
  60. <?php endif ?>
  61.  
  62. <?php if ( isset( $city ) && $city && tribe_get_city() != '' ): ?>
  63. <span class="tribe-events-locality"><?php echo tribe_get_city(); ?></span>
  64. <?php endif ?>
  65.  
  66. <?php if ( isset( $region ) && $region && tribe_get_region() != '' ): ?>
  67. <span class="tribe-events-region"><?php echo tribe_get_region(); ?></span>
  68. <?php endif ?>
  69.  
  70. <?php if ( isset( $zip ) && $zip && tribe_get_zip() != '' ): ?>
  71. <span class="tribe-events-postal-code"><?php echo tribe_get_zip(); ?></span>
  72. <?php endif ?>
  73.  
  74. <?php if ( isset( $country ) && $country && tribe_get_country() != '' ): ?>
  75. <span class="tribe-country-name"><?php echo tribe_get_country(); ?></span>
  76. <?php endif ?>
  77.  
  78. <?php if ( ! empty( $organizer_ids ) ): ?>
  79. <span class="tribe-events-organizer">
  80. <?php echo tribe_get_organizer_label_singular( ! $multiple_organizers ); ?>:
  81. <?php
  82. $organizer_links = array();
  83. foreach ( $organizer_ids as $organizer_id ) {
  84. if ( ! $organizer_id ) {
  85. continue;
  86. }
  87. $organizer_links[] = tribe_get_organizer_link( $organizer_id, true, false );
  88. }// end foreach
  89. $and = _x( 'and', 'list separator for final two elements', 'tribe-events-calendar-pro' );
  90. if ( 1 == count( $organizer_links ) ) {
  91. echo $organizer_links[0];
  92. }// end if
  93. elseif ( 2 == count( $organizer_links ) ) {
  94. echo $organizer_links[0] . ' ' . esc_html( $and ) . ' ' . $organizer_links[1];
  95. }// end elseif
  96. else {
  97. $last_organizer = array_pop( $organizer_links );
  98. echo implode( ', ', $organizer_links );
  99. echo esc_html( ', ' . $and . ' ' );
  100. echo $last_organizer;
  101. }// end else
  102. ?>
  103. </span>
  104. <?php endif ?>
  105.  
  106. <?php if ( isset( $phone ) && $phone && tribe_get_phone() != '' ): ?>
  107. <span class="tribe-events-tel"><?php echo tribe_get_phone(); ?></span>
  108. <?php endif ?>
  109.  
  110. </div>
  111.  
  112. <?php do_action( 'tribe_events_list_widget_after_the_meta' ) ?>
  113.  
  114. </div> <!-- .list-info -->
  115. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement