Skip to content

Instantly share code, notes, and snippets.

@codingmusician
Created April 8, 2019 21:46
Show Gist options
  • Save codingmusician/dbc288512562f61961795fa3eae5d52e to your computer and use it in GitHub Desktop.
Save codingmusician/dbc288512562f61961795fa3eae5d52e to your computer and use it in GitHub Desktop.
<?php
/*
* When using the Custom Post Type Permalinks plugin, it was found that event URL were malformed
* The snippet below was created by a customer to fix that issue
*/
function cptp_fix_recurring_event_links($url, $post, $leavename, $sample) {
$url = str_replace('%tribe_events_slug%/%tribe_events_cat%', 'event', $url);
return $url;
}
add_filter('post_type_link', 'cptp_fix_recurring_event_links', 10, 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment