Advertisement
Guest User

Bug fix for Business Calendar (event_pages.php)

a guest
Sep 2nd, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. <?php
  2. // CONTROL THE EVENT PAGES AND MANAGE THE ACCESS PERMISSIONS
  3.  
  4. // trick to avoid issues with future events
  5. add_filter( 'posts_results', 'bc_future_events_hack', null, 2 );
  6. function bc_future_events_hack( $posts, &$query ) {
  7.     if(!is_array($posts) || !isset($posts[0])) {return $posts;} // this was returning false but in the case where $posts is an empty array that is incorrect, so just return $posts
  8. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement