The term_link
filter has a different signature for its callback function than the page_link
filter, meaning the arguments in your callback are different. (Also note you’ll need to explicitly set the argument number when you call add_filter
because by default add_filter
will only setup 1 argument. For example:
add_filter( 'term_link', 'lqd_series_link', 10, 3 ); // Where 3 is the number of arguments for your callback function
Then in your callback:
function lqd_series_link( $url, $term, $taxonomy ) {
global $wp_query;
if ( $taxonomy == 'gc-sermon-series' && isset( $wp_query->query_vars['app-view'] ) ) {
return $url . 'app-view/';
}
return $url;
}