Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Let's set up a filter than transforms the status of month views from 404 (if a given
- * month happens to be devoid of events) to 200.
- */
- add_filter('status_header', 'avoid_tribe_month_view_404s');
- function avoid_tribe_month_view_404s($status) {
- global $wp_query;
- if ( ! isset($wp_query->query_vars['eventDisplay'])
- || 'month' !== $wp_query->query_vars['eventDisplay']
- || false === strpos($status, '404 Not Found') )
- return $status;
- $wp_query->is_404 = false;
- return str_replace('404 Not Found', '200 OK', $status);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement