Created
April 8, 2019 21:46
-
-
Save codingmusician/dbc288512562f61961795fa3eae5d52e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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