Fix custom taxonomy term links when using non-pretty permalinks. Props bookchiq. fixes #11179
git-svn-id: https://develop.svn.wordpress.org/trunk@12229 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d288c8eea0
commit
dd4f87da0d
|
@ -2216,7 +2216,7 @@ function get_term_link( $term, $taxonomy ) {
|
||||||
$slug = $term->slug;
|
$slug = $term->slug;
|
||||||
|
|
||||||
if ( empty($termlink) ) {
|
if ( empty($termlink) ) {
|
||||||
$file = get_option('home') . '/';
|
$file = trailingslashit( get_option('home') );
|
||||||
$t = get_taxonomy($taxonomy);
|
$t = get_taxonomy($taxonomy);
|
||||||
if ( $t->query_var )
|
if ( $t->query_var )
|
||||||
$termlink = "$file?$t->query_var=$slug";
|
$termlink = "$file?$t->query_var=$slug";
|
||||||
|
@ -2224,7 +2224,7 @@ function get_term_link( $term, $taxonomy ) {
|
||||||
$termlink = "$file?taxonomy=$taxonomy&term=$slug";
|
$termlink = "$file?taxonomy=$taxonomy&term=$slug";
|
||||||
} else {
|
} else {
|
||||||
$termlink = str_replace("%$taxonomy%", $slug, $termlink);
|
$termlink = str_replace("%$taxonomy%", $slug, $termlink);
|
||||||
$termlink = get_option('home') . user_trailingslashit($termlink, 'category');
|
$termlink = trailingslashit( get_option('home') ) . user_trailingslashit($termlink, 'category');
|
||||||
}
|
}
|
||||||
return apply_filters('term_link', $termlink, $term, $taxonomy);
|
return apply_filters('term_link', $termlink, $term, $taxonomy);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue