Guest User

List Widget override remove recurring event link TEC v3.6

a guest
Jun 12th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.20 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Events Pro List Widget Template
  4.  * This is the template for the output of the events list widget.
  5.  * All the items are turned on and off through the widget admin.
  6.  * There is currently no default styling, which is highly needed.
  7.  *
  8.  * Override this template in your own theme by creating a file at [your-theme]/tribe-events/widgets/list-widget.php
  9.  *
  10.  * When the template is loaded, the following vars are set: $start, $end, $venue,
  11.  * $address, $city, $state, $province'], $zip, $country, $phone, $cost
  12.  *
  13.  * @package TribeEventsCalendarPro
  14.  * @since  1.0
  15.  * @author Modern Tribe Inc.
  16.  *
  17.  */
  18.  
  19. if ( !defined('ABSPATH') ) die('-1');
  20.  
  21. // Have taxonomy filters been applied?
  22. $filters = json_decode( $filters, true );
  23.  
  24. // Is the filter restricted to a single taxonomy?
  25. $single_taxonomy = ( is_array( $filters ) && 1 === count( $filters ) );
  26. $single_term = false;
  27.  
  28. // Pull the actual taxonomy and list of terms into scope
  29. if ( $single_taxonomy ) foreach ( $filters as $taxonomy => $terms );
  30.  
  31. // If we have a single taxonomy and a single term, the View All link should point to the relevant archive page
  32. if ( $single_taxonomy && 1 === count( $terms ) ) {
  33.     $link_to_archive = true;
  34.     $link_to_all = get_term_link( absint( $terms[0] ), $taxonomy );
  35. }
  36.  
  37. // Otherwise link to the main events page
  38. else {
  39.     $link_to_archive = false;
  40.     $link_to_all = tribe_get_events_link();
  41. }
  42.  
  43. // Check if any posts were found
  44. if ( $posts ):
  45.     ?>
  46.     <ol class="hfeed vcalendar">
  47.         <?php
  48.         foreach( $posts as $post ) :
  49.             setup_postdata( $post );
  50.             ?>
  51.             <li class="<?php tribe_events_event_classes() ?>">
  52.  
  53.                 <?php do_action( 'tribe_events_list_widget_before_the_event_title' ); ?>
  54.  
  55.                 <h4 class="entry-title summary">
  56.                     <a href="<?php echo tribe_get_event_link(); ?>" rel="bookmark"><?php the_title(); ?></a>
  57.                 </h4>
  58.  
  59.                 <?php do_action( 'tribe_events_list_widget_after_the_event_title' ); ?>
  60.  
  61.                 <?php do_action( 'tribe_events_list_widget_before_the_meta' ) ?>
  62.  
  63.                 <div class="duration">
  64.                     <?php
  65.                     $tep = TribeEventsPro::instance();
  66.                     $tep->disable_recurring_info_tooltip();
  67.                     echo tribe_events_event_schedule_details();
  68.                     $tep->enable_recurring_info_tooltip();?>
  69.                 </div>
  70.                 <?php if ( $cost && tribe_get_cost() != '' ) { ?>
  71.                     <span class="tribe-events-divider">|</span>
  72.                     <div class="tribe-events-event-cost">
  73.                         <?php echo tribe_get_cost( null, true ); ?>
  74.                     </div>
  75.                 <?php } ?>
  76.                 <div class="vcard adr location">
  77.  
  78.                     <?php if ( $venue  && tribe_get_venue() != '') { ?>
  79.                         <span class="fn org tribe-venue"><?php echo tribe_get_venue_link(); ?></span>
  80.                     <?php } ?>
  81.  
  82.                     <?php if ( $address && tribe_get_address() != '' ) { ?>
  83.                         <span class="street-address"><?php echo tribe_get_address(); ?></span>
  84.                     <?php } ?>
  85.  
  86.                     <?php if ( $city && tribe_get_city() != '' ) { ?>
  87.                         <span class="locality"><?php echo tribe_get_city(); ?></span>
  88.                     <?php } ?>
  89.  
  90.                     <?php if ( $region && tribe_get_region() !='' ) { ?>
  91.                         <span class="region"><?php echo tribe_get_region(); ?></span>
  92.                     <?php   } ?>
  93.  
  94.                     <?php if ( $zip && tribe_get_zip() != '' ) { ?>
  95.                         <span class="postal-code"><?php echo tribe_get_zip(); ?></span>
  96.                     <?php } ?>
  97.  
  98.                     <?php if ( $country  && tribe_get_country() != '') { ?>
  99.                         <span class="country-name"><?php echo tribe_get_country(); ?></span>
  100.                     <?php } ?>
  101.  
  102.                     <?php if ( $organizer && tribe_get_organizer() != '' ) { ?>
  103.                         <?php _e( 'Organizer:', 'tribe-events-calendar-pro' ); ?>
  104.                         <span class="tribe-organizer"><?php echo tribe_get_organizer_link(); ?></span>
  105.                     <?php } ?>
  106.  
  107.                     <?php if ( $phone && tribe_get_phone() != '' ) { ?>
  108.                         <span class="tel"><?php echo tribe_get_phone(); ?></span>
  109.                     <?php } ?>
  110.                 </div>
  111.  
  112.                 <?php do_action( 'tribe_events_list_widget_after_the_meta' ) ?>
  113.  
  114.             </li>
  115.         <?php
  116.         endforeach;
  117.         ?>
  118.     </ol><!-- .hfeed -->
  119.  
  120.     <p class="tribe-events-widget-link">
  121.         <a href="<?php esc_attr_e( esc_url( $link_to_all ) ) ?>" rel="bookmark">
  122.             <?php _e( 'View More&hellip;', 'tribe-events-calendar' ) ?>
  123.         </a>
  124.     </p>
  125. <?php
  126. // No Events were Found
  127. else:
  128.     ?>
  129.     <p><?php _e( 'There are no upcoming events at this time.', 'tribe-events-calendar' ) ?></p>
  130. <?php
  131. endif;
Advertisement
Add Comment
Please, Sign In to add comment