/** * Output an html link to a day * * @param string $date 'previous day', 'next day', 'yesterday', 'tomorrow', or any date string that strtotime() can parse * @param string $text text for the link * @return void * @since 3.0 **/ function tribe_the_day_link($date = null, $text = null) { try { if (is_null($text)) { $text = tribe_get_the_day_link_label($date); } $date = tribe_get_the_day_link_date($date); $link = tribe_get_day_link($date); $html = '<a href="' . $link . '" data-day="' . $date . '" rel="prev">' . $text . '</a>'; } catch (OverflowException $e) { $html = ''; } echo apply_filters('tribe_the_day_link', $html); }
/** * Output an html link to a day * * @category Events * @param string $date 'previous day', 'next day', 'yesterday', 'tomorrow', or any date string that strtotime() can parse * @param string $text text for the link * **/ function tribe_the_day_link($date = null, $text = null) { $html = ''; try { if (is_null($text)) { $text = tribe_get_the_day_link_label($date); } $date = tribe_get_the_day_link_date($date); $link = tribe_get_day_link($date); $earliest = tribe_events_earliest_date(Tribe__Date_Utils::DBDATEFORMAT); $latest = tribe_events_latest_date(Tribe__Date_Utils::DBDATEFORMAT); if ($date >= $earliest && $date <= $latest) { $html = '<a href="' . esc_url($link) . '" data-day="' . $date . '" rel="prev">' . $text . '</a>'; } } catch (OverflowException $e) { } echo apply_filters('tribe_the_day_link', $html); }