WordPress.org

Make WordPress Core

Changeset 5011


Ignore:
Timestamp:
03/10/2007 01:13:49 AM (11 years ago)
Author:
ryan
Message:

Link filters from jhodgdon. fixes #3595

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/link-import.php

    r4953 r5011  
    4949foreach ($categories as $category) {
    5050?>
    51 <option value="<?php echo $category->cat_ID; ?>"><?php echo wp_specialchars($category->cat_name); ?></option>
     51<option value="<?php echo $category->cat_ID; ?>"><?php echo wp_specialchars(apply_filters('link_category', $category->cat_name)); ?></option>
    5252<?php
    5353} // end foreach
  • trunk/wp-admin/link-manager.php

    r4700 r5011  
    8181$select_cat .= '<option value="all"'  . (($cat_id == 'all') ? " selected='selected'" : '') . '>' . __('All') . "</option>\n";
    8282foreach ((array) $categories as $cat)
    83     $select_cat .= '<option value="' . $cat->cat_ID . '"' . (($cat->cat_ID == $cat_id) ? " selected='selected'" : '') . '>' . wp_specialchars($cat->cat_name) . "</option>\n";
     83    $select_cat .= '<option value="' . $cat->cat_ID . '"' . (($cat->cat_ID == $cat_id) ? " selected='selected'" : '') . '>' . wp_specialchars(apply_filters('link_category', $cat->cat_name)) . "</option>\n";
    8484$select_cat .= "</select>\n";
    8585
     
    132132<?php
    133133    foreach ($links as $link) {
    134         $link->link_name = attribute_escape($link->link_name);
    135         $link->link_description = wp_specialchars($link->link_description);
     134        $link->link_name = attribute_escape(apply_filters('link_title', $link->link_name));
     135        $link->link_description = wp_specialchars(apply_filters('link_description', $link->link_description));
    136136        $link->link_url = attribute_escape($link->link_url);
    137137        $link->link_category = wp_get_link_cats($link->link_id);
     
    161161                    foreach ($link->link_category as $category) {
    162162                        $cat_name = get_the_category_by_ID($category);
    163                         $cat_name = wp_specialchars($cat_name);
     163                        $cat_name = wp_specialchars(apply_filters('link_category', $cat_name));
    164164                        if ( $cat_id != $category )
    165165                            $cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>";
  • trunk/wp-includes/bookmark-template.php

    r4964 r5011  
    267267            $rel = ' rel="' . $rel . '"';
    268268
    269         $desc = attribute_escape($bookmark->link_description);
    270         $name = attribute_escape($bookmark->link_name);
    271         $title = $desc;
     269        $desc = attribute_escape(apply_filters('link_description', $bookmark->link_description));
     270        $name = attribute_escape(apply_filters('link_title', $bookmark->link_name));
     271        $title = $desc;
    272272
    273273        if ( $show_updated )
     
    337337                continue;
    338338            $output .= str_replace(array('%id', '%class'), array("linkcat-$cat->cat_ID", $class), $category_before);
    339             $output .= "$title_before$cat->cat_name$title_after\n\t<ul>\n";
     339            $catname = apply_filters( "link_category", $cat->cat_name );
     340            $output .= "$title_before$catname$title_after\n\t<ul>\n";
    340341            $output .= _walk_bookmarks($bookmarks, $r);
    341342            $output .= "\n\t</ul>\n$category_after\n";
  • trunk/wp-links-opml.php

    r4656 r5011  
    3030
    3131foreach ((array) $cats as $cat) {
     32    $catname = apply_filters('link_category', $cat->cat_name);
     33
    3234?>
    33 <outline type="category" title="<?php echo attribute_escape($cat->cat_name); ?>">
     35<outline type="category" title="<?php echo attribute_escape($catname); ?>">
    3436<?php
    3537
    3638    $bookmarks = get_bookmarks("category={$cat->cat_ID}");
    3739    foreach ((array) $bookmarks as $bookmark) {
     40        $title = attribute_escape(apply_filters('link_title', $bookmark->link_name));
    3841?>
    39     <outline text="<?php echo attribute_escape($bookmark->link_name); ?>" type="link" xmlUrl="<?php echo attribute_escape($bookmark->link_rss); ?>" htmlUrl="<?php echo attribute_escape($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) echo $bookmark->link_updated; ?>" />
     42    <outline text="<?php echo $title; ?>" type="link" xmlUrl="<?php echo attribute_escape($bookmark->link_rss); ?>" htmlUrl="<?php echo attribute_escape($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) echo $bookmark->link_updated; ?>" />
    4043<?php
    4144
Note: See TracChangeset for help on using the changeset viewer.