Link filters from jhodgdon. fixes #3595
git-svn-id: https://develop.svn.wordpress.org/trunk@5011 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c79783485f
commit
0018169c02
@ -48,7 +48,7 @@ switch ($step) {
|
||||
$categories = get_categories('hide_empty=0');
|
||||
foreach ($categories as $category) {
|
||||
?>
|
||||
<option value="<?php echo $category->cat_ID; ?>"><?php echo wp_specialchars($category->cat_name); ?></option>
|
||||
<option value="<?php echo $category->cat_ID; ?>"><?php echo wp_specialchars(apply_filters('link_category', $category->cat_name)); ?></option>
|
||||
<?php
|
||||
} // end foreach
|
||||
?>
|
||||
|
@ -80,7 +80,7 @@ $categories = get_categories("hide_empty=1&type=link");
|
||||
$select_cat = "<select name=\"cat_id\">\n";
|
||||
$select_cat .= '<option value="all"' . (($cat_id == 'all') ? " selected='selected'" : '') . '>' . __('All') . "</option>\n";
|
||||
foreach ((array) $categories as $cat)
|
||||
$select_cat .= '<option value="' . $cat->cat_ID . '"' . (($cat->cat_ID == $cat_id) ? " selected='selected'" : '') . '>' . wp_specialchars($cat->cat_name) . "</option>\n";
|
||||
$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";
|
||||
$select_cat .= "</select>\n";
|
||||
|
||||
$select_order = "<select name=\"order_by\">\n";
|
||||
@ -131,8 +131,8 @@ if ( $links ) {
|
||||
<tbody id="the-list">
|
||||
<?php
|
||||
foreach ($links as $link) {
|
||||
$link->link_name = attribute_escape($link->link_name);
|
||||
$link->link_description = wp_specialchars($link->link_description);
|
||||
$link->link_name = attribute_escape(apply_filters('link_title', $link->link_name));
|
||||
$link->link_description = wp_specialchars(apply_filters('link_description', $link->link_description));
|
||||
$link->link_url = attribute_escape($link->link_url);
|
||||
$link->link_category = wp_get_link_cats($link->link_id);
|
||||
$short_url = str_replace('http://', '', $link->link_url);
|
||||
@ -160,7 +160,7 @@ if ( $links ) {
|
||||
$cat_names = array();
|
||||
foreach ($link->link_category as $category) {
|
||||
$cat_name = get_the_category_by_ID($category);
|
||||
$cat_name = wp_specialchars($cat_name);
|
||||
$cat_name = wp_specialchars(apply_filters('link_category', $cat_name));
|
||||
if ( $cat_id != $category )
|
||||
$cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>";
|
||||
$cat_names[] = $cat_name;
|
||||
|
@ -266,9 +266,9 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
|
||||
if ( '' != $rel )
|
||||
$rel = ' rel="' . $rel . '"';
|
||||
|
||||
$desc = attribute_escape($bookmark->link_description);
|
||||
$name = attribute_escape($bookmark->link_name);
|
||||
$title = $desc;
|
||||
$desc = attribute_escape(apply_filters('link_description', $bookmark->link_description));
|
||||
$name = attribute_escape(apply_filters('link_title', $bookmark->link_name));
|
||||
$title = $desc;
|
||||
|
||||
if ( $show_updated )
|
||||
if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) {
|
||||
@ -336,7 +336,8 @@ function wp_list_bookmarks($args = '') {
|
||||
if ( empty($bookmarks) )
|
||||
continue;
|
||||
$output .= str_replace(array('%id', '%class'), array("linkcat-$cat->cat_ID", $class), $category_before);
|
||||
$output .= "$title_before$cat->cat_name$title_after\n\t<ul>\n";
|
||||
$catname = apply_filters( "link_category", $cat->cat_name );
|
||||
$output .= "$title_before$catname$title_after\n\t<ul>\n";
|
||||
$output .= _walk_bookmarks($bookmarks, $r);
|
||||
$output .= "\n\t</ul>\n$category_after\n";
|
||||
}
|
||||
|
@ -29,14 +29,17 @@ else
|
||||
$cats = array (get_category($link_cat));
|
||||
|
||||
foreach ((array) $cats as $cat) {
|
||||
$catname = apply_filters('link_category', $cat->cat_name);
|
||||
|
||||
?>
|
||||
<outline type="category" title="<?php echo attribute_escape($cat->cat_name); ?>">
|
||||
<outline type="category" title="<?php echo attribute_escape($catname); ?>">
|
||||
<?php
|
||||
|
||||
$bookmarks = get_bookmarks("category={$cat->cat_ID}");
|
||||
foreach ((array) $bookmarks as $bookmark) {
|
||||
$title = attribute_escape(apply_filters('link_title', $bookmark->link_name));
|
||||
?>
|
||||
<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; ?>" />
|
||||
<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; ?>" />
|
||||
<?php
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user