Advertisement
BakerMan

Stop links to Jan 2038

Aug 12th, 2013
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. /**
  2.  * In some installations category month views for dates in 2038 onwards result in a server error which may have SEO
  3.  * ramifications (as a bot might crawl to these links and encounter a 503).
  4.  *
  5.  * This function is a bit of a string function hatchet job but should resolve this even so. An equivalent to kill links
  6.  * to dates before the Unix epoch could be similarly set up using the equivalent prev_month filter.
  7.  */
  8. function avoid_2038_503s($html) {
  9.     if (false !== strpos($html, 'data-month="2038-01"')) return '';
  10.     return $html;
  11. }
  12.  
  13. add_filter('tribe_events_the_next_month_link', 'avoid_2038_503s');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement