Skip to content

Instantly share code, notes, and snippets.

@barryhughes
Created November 11, 2014 14:22
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 barryhughes/5ed4676ce7ebfe30d376 to your computer and use it in GitHub Desktop.
Save barryhughes/5ed4676ce7ebfe30d376 to your computer and use it in GitHub Desktop.
Helper for customizations relying on front page pagination hack
<?php
/**
* Workaround for themes, plugins and customizations that rely on
* redirect_canonical() *not* redirecting when pagination is used
* on a static front page.
*/
add_action( 'init', 'modify_pro_canonical_filter' );
function modify_pro_canonical_filter() {
if ( ! class_exists( 'TribeEventsPro' ) ) return;
$pro = TribeEventsPro::instance();
$filter = array( $pro, 'filter_canonical_link_on_recurring_events' );
remove_filter( 'wp', $filter, 10, 1 );
add_filter( 'template_redirect', $filter, 20, 1 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment