Skip to content

Instantly share code, notes, and snippets.

@caseydriscoll
Created August 13, 2014 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caseydriscoll/7068a8b9440d34c872b5 to your computer and use it in GitHub Desktop.
Save caseydriscoll/7068a8b9440d34c872b5 to your computer and use it in GitHub Desktop.
Tribe: Fix Month View link problem for recurring events
// When you only have recurring events, the next month link won't show. Resave the event or add this snippet.
// Written by Barry Hughes
// Problem thread: http://tri.be/support/forums/topic/one-side-of-month-pagination-missing/
add_action( 'added_post_meta', 'fix_29781_recurrence_pagination', 10, 3 );
function fix_29781_recurrence_pagination( $meta_id, $object_id, $meta_key ) {
if ( TribeEvents::POSTTYPE !== get_post_type( $object_id ) ) return;
if ( '_EventDuration' !== $meta_key ) return;
TribeEvents::instance()->rebuild_earliest_latest();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment