I previously wrote a question about rewriting a URL based on an originating URL and Milo provided me with a working answer for pages/posts. But now I am trying to do a taxonomy rewrite and the same functionality seems to break things.
Here is my code:
function lqd_series_link( $term_id, $taxonomy ) {
if ( $taxonomy == 'gc-sermon-series' && isset( $wp_query->query_vars['app-view'] ) ) {
return $taxonomy; // I've also tried $link
}
return $taxonomy;
}
add_filter( 'term_link', 'lqd_series_link' );
What is strangest is what this results in. So if I do the code as Milo instructed on the question linked above I end up with a URL for pages like:
https://liquidchurch.com/messages/app-view/
But when I use the above code I end up with the same exact thing:
https://liquidchurch.com/messages/app-view/
Thoughts?