Make WordPress Core

Changeset 4790


Ignore:
Timestamp:
01/23/2007 08:21:28 AM (19 years ago)
Author:
markjaquith
Message:

Do not attempt to use rel-tag for URL schemes that do not support it. fixes #3265

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r4774 r4790  
    8686
    8787function get_the_category_list($separator = '', $parents='') {
     88    global $wp_rewrite;
    8889    $categories = get_the_category();
    8990    if (empty($categories))
    9091        return apply_filters('the_category', __('Uncategorized'), $separator, $parents);
     92
     93    $rel = ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"';
    9194
    9295    $thelist = '';
     
    99102                    if ($category->category_parent)
    100103                        $thelist .= get_category_parents($category->category_parent, TRUE);
    101                     $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>';
     104                    $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>';
    102105                    break;
    103106                case 'single':
    104                     $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . ' rel="category tag">';
     107                    $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '">';
    105108                    if ($category->category_parent)
    106109                        $thelist .= get_category_parents($category->category_parent, FALSE);
     
    109112                case '':
    110113                default:
    111                     $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>';
     114                    $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>';
    112115            }
    113116        }
     
    122125                    if ( $category->category_parent )
    123126                        $thelist .= get_category_parents($category->category_parent, TRUE);
    124                     $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>';
     127                    $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '">' . $category->cat_name.'</a>';
    125128                    break;
    126129                case 'single':
    127                     $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">';
     130                    $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '">';
    128131                    if ( $category->category_parent )
    129132                        $thelist .= get_category_parents($category->category_parent, FALSE);
     
    132135                case '':
    133136                default:
    134                     $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>';
     137                    $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '">' . $category->cat_name.'</a>';
    135138            }
    136139            ++$i;
Note: See TracChangeset for help on using the changeset viewer.