From 2e2dde094461257e08865048850ceadfb77409e6 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 22 Mar 2005 00:08:57 +0000 Subject: [PATCH] Honor echo var in get_links(). http://mosquito.wordpress.org/view.php?id=1023 Props: MC_incubus git-svn-id: https://develop.svn.wordpress.org/trunk@2461 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/links.php | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/wp-includes/links.php b/wp-includes/links.php index 1997c54d88..1c4e7d6e5d 100644 --- a/wp-includes/links.php +++ b/wp-includes/links.php @@ -168,19 +168,27 @@ function get_links($category = -1, $before = '', $after = '
', if (!$results) { return; } + + $output = ""; + foreach ($results as $row) { if (!isset($row->recently_updated)) $row->recently_updated = false; - echo($before); + $output .= ($before); + if ($show_updated && $row->recently_updated) { - echo get_settings('links_recently_updated_prepend'); + $output .= get_settings('links_recently_updated_prepend'); } + $the_link = '#'; + if ( !empty($row->link_url) ) $the_link = wp_specialchars($row->link_url); $rel = $row->link_rel; + if ($rel != '') { $rel = " rel='$rel'"; } + $desc = wp_specialchars($row->link_description, ENT_QUOTES); $name = wp_specialchars($row->link_name, ENT_QUOTES); @@ -202,27 +210,37 @@ function get_links($category = -1, $before = '', $after = '
', if ('' != $target) { $target = " target='$target'"; } - echo("'); + + $output.= "link_image != null) && $show_images) { if (strstr($row->link_image, 'http')) - echo ""; + $output.= ""; else // If it's a relative path - echo "link_image' $alt $title />"; + $output.= "link_image' $alt $title />"; } else { - echo($name); + $output.= $name; } - echo(''); + + $output.= ''; + if ($show_updated && $row->recently_updated) { - echo get_settings('links_recently_updated_append'); + $output.= get_settings('links_recently_updated_append'); } if ($show_description && ($desc != '')) { - echo($between.$desc); + $output.= $between.$desc; } - echo("$after\n"); + $output.= "$after\n"; } // end while + + if($echo) { + echo $output; + } else { + return $output; + } }