mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
Do not attempt to use rel-tag for URL schemes that do not support it. fixes #3265
git-svn-id: http://svn.automattic.com/wordpress/trunk@4790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
27e9efe1cd
commit
b9490b45c2
@ -85,10 +85,13 @@ function get_the_category_by_ID($cat_ID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_the_category_list($separator = '', $parents='') {
|
function get_the_category_list($separator = '', $parents='') {
|
||||||
|
global $wp_rewrite;
|
||||||
$categories = get_the_category();
|
$categories = get_the_category();
|
||||||
if (empty($categories))
|
if (empty($categories))
|
||||||
return apply_filters('the_category', __('Uncategorized'), $separator, $parents);
|
return apply_filters('the_category', __('Uncategorized'), $separator, $parents);
|
||||||
|
|
||||||
|
$rel = ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"';
|
||||||
|
|
||||||
$thelist = '';
|
$thelist = '';
|
||||||
if ( '' == $separator ) {
|
if ( '' == $separator ) {
|
||||||
$thelist .= '<ul class="post-categories">';
|
$thelist .= '<ul class="post-categories">';
|
||||||
@ -98,17 +101,17 @@ function get_the_category_list($separator = '', $parents='') {
|
|||||||
case 'multiple':
|
case 'multiple':
|
||||||
if ($category->category_parent)
|
if ($category->category_parent)
|
||||||
$thelist .= get_category_parents($category->category_parent, TRUE);
|
$thelist .= get_category_parents($category->category_parent, TRUE);
|
||||||
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a></li>';
|
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '">' . $category->cat_name.'</a></li>';
|
||||||
break;
|
break;
|
||||||
case 'single':
|
case 'single':
|
||||||
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . ' rel="category tag">';
|
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '">';
|
||||||
if ($category->category_parent)
|
if ($category->category_parent)
|
||||||
$thelist .= get_category_parents($category->category_parent, FALSE);
|
$thelist .= get_category_parents($category->category_parent, FALSE);
|
||||||
$thelist .= $category->cat_name.'</a></li>';
|
$thelist .= $category->cat_name.'</a></li>';
|
||||||
break;
|
break;
|
||||||
case '':
|
case '':
|
||||||
default:
|
default:
|
||||||
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a></li>';
|
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '">' . $category->cat_name.'</a></li>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$thelist .= '</ul>';
|
$thelist .= '</ul>';
|
||||||
@ -121,17 +124,17 @@ function get_the_category_list($separator = '', $parents='') {
|
|||||||
case 'multiple':
|
case 'multiple':
|
||||||
if ( $category->category_parent )
|
if ( $category->category_parent )
|
||||||
$thelist .= get_category_parents($category->category_parent, TRUE);
|
$thelist .= get_category_parents($category->category_parent, TRUE);
|
||||||
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a>';
|
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '">' . $category->cat_name.'</a>';
|
||||||
break;
|
break;
|
||||||
case 'single':
|
case 'single':
|
||||||
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">';
|
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '">';
|
||||||
if ( $category->category_parent )
|
if ( $category->category_parent )
|
||||||
$thelist .= get_category_parents($category->category_parent, FALSE);
|
$thelist .= get_category_parents($category->category_parent, FALSE);
|
||||||
$thelist .= "$category->cat_name</a>";
|
$thelist .= "$category->cat_name</a>";
|
||||||
break;
|
break;
|
||||||
case '':
|
case '':
|
||||||
default:
|
default:
|
||||||
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a>';
|
$thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '">' . $category->cat_name.'</a>';
|
||||||
}
|
}
|
||||||
++$i;
|
++$i;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user