Example #1
0
 /**
  * Prints out data attributes used in the template header tags
  *
  * @param string|null $current_view
  * @return void
  * @since 3.0
  **/
 function tribe_events_the_header_attributes($current_view = null)
 {
     $attrs = array();
     $current_view = !empty($current_view) ? $current_view : basename(tribe_get_current_template());
     $attrs['data-title'] = wp_title('»', false);
     switch ($current_view) {
         case 'month.php':
             $attrs['data-view'] = 'month';
             $attrs['data-date'] = date('Y-m', strtotime(tribe_get_month_view_date()));
             $attrs['data-baseurl'] = tribe_get_gridview_link(false);
             break;
         case 'list.php':
             $attrs['data-view'] = 'list';
             if (tribe_is_upcoming()) {
                 $attrs['data-baseurl'] = tribe_get_listview_link(false);
             } elseif (tribe_is_past()) {
                 $attrs['data-view'] = 'past';
                 $attrs['data-baseurl'] = tribe_get_listview_past_link(false);
             }
             break;
     }
     $attrs = apply_filters('tribe_events_header_attributes', $attrs, $current_view);
     foreach ($attrs as $attr => $value) {
         echo " {$attr}=" . '"' . $value . '"';
     }
 }
Example #2
0
 /**
  * Prints out data attributes used in the template header tags
  *
  * @category Events
  * @param string|null $current_view
  *
  * @return void
  * @todo move to template classes
  **/
 function tribe_events_the_header_attributes($current_view = null)
 {
     $attrs = array();
     $current_view = !empty($current_view) ? $current_view : basename(tribe_get_current_template());
     $attrs['data-title'] = wp_title('|', false, 'right');
     switch ($current_view) {
         case 'month.php':
             $attrs['data-view'] = 'month';
             $attrs['data-date'] = date('Y-m', strtotime(tribe_get_month_view_date()));
             $attrs['data-baseurl'] = tribe_get_gridview_link(false);
             break;
         case 'day.php':
             $attrs['data-startofweek'] = get_option('start_of_week');
             break;
         case 'list.php':
             $attrs['data-startofweek'] = get_option('start_of_week');
             $attrs['data-view'] = 'list';
             if (tribe_is_upcoming()) {
                 $attrs['data-baseurl'] = tribe_get_listview_link(false);
             } elseif (tribe_is_past()) {
                 $attrs['data-view'] = 'past';
                 $attrs['data-baseurl'] = tribe_get_listview_past_link(false);
             }
             break;
     }
     if (has_filter('tribe_events_mobile_breakpoint')) {
         $attrs['data-mobilebreak'] = tribe_get_mobile_breakpoint();
     }
     $attrs = apply_filters('tribe_events_header_attributes', $attrs, $current_view);
     foreach ($attrs as $attr => $value) {
         echo " {$attr}=" . '"' . esc_attr($value) . '"';
     }
 }
Example #3
0
 /**
  * @deprecated
  */
 function sp_get_listview_past_link()
 {
     _deprecated_function(__FUNCTION__, '2.0', 'tribe_get_listview_past_link()');
     return tribe_get_listview_past_link();
 }