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
This commit is contained in:
parent
5604f11a02
commit
2e2dde0944
@ -168,19 +168,27 @@ function get_links($category = -1, $before = '', $after = '<br />',
|
|||||||
if (!$results) {
|
if (!$results) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$output = "";
|
||||||
|
|
||||||
foreach ($results as $row) {
|
foreach ($results as $row) {
|
||||||
if (!isset($row->recently_updated)) $row->recently_updated = false;
|
if (!isset($row->recently_updated)) $row->recently_updated = false;
|
||||||
echo($before);
|
$output .= ($before);
|
||||||
|
|
||||||
if ($show_updated && $row->recently_updated) {
|
if ($show_updated && $row->recently_updated) {
|
||||||
echo get_settings('links_recently_updated_prepend');
|
$output .= get_settings('links_recently_updated_prepend');
|
||||||
}
|
}
|
||||||
|
|
||||||
$the_link = '#';
|
$the_link = '#';
|
||||||
|
|
||||||
if ( !empty($row->link_url) )
|
if ( !empty($row->link_url) )
|
||||||
$the_link = wp_specialchars($row->link_url);
|
$the_link = wp_specialchars($row->link_url);
|
||||||
$rel = $row->link_rel;
|
$rel = $row->link_rel;
|
||||||
|
|
||||||
if ($rel != '') {
|
if ($rel != '') {
|
||||||
$rel = " rel='$rel'";
|
$rel = " rel='$rel'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$desc = wp_specialchars($row->link_description, ENT_QUOTES);
|
$desc = wp_specialchars($row->link_description, ENT_QUOTES);
|
||||||
$name = wp_specialchars($row->link_name, ENT_QUOTES);
|
$name = wp_specialchars($row->link_name, ENT_QUOTES);
|
||||||
|
|
||||||
@ -202,27 +210,37 @@ function get_links($category = -1, $before = '', $after = '<br />',
|
|||||||
if ('' != $target) {
|
if ('' != $target) {
|
||||||
$target = " target='$target'";
|
$target = " target='$target'";
|
||||||
}
|
}
|
||||||
echo("<a href='$the_link'");
|
|
||||||
echo($rel . $title . $target);
|
$output.= "<a href='$the_link'";
|
||||||
echo('>');
|
$output.= $rel . $title . $target;
|
||||||
|
$output.= '>';
|
||||||
|
|
||||||
if (($row->link_image != null) && $show_images) {
|
if (($row->link_image != null) && $show_images) {
|
||||||
if (strstr($row->link_image, 'http'))
|
if (strstr($row->link_image, 'http'))
|
||||||
echo "<img src='$row->link_image' $alt $title />";
|
$output.= "<img src='$row->link_image' $alt $title />";
|
||||||
else // If it's a relative path
|
else // If it's a relative path
|
||||||
echo "<img src='" . get_settings('siteurl') . "$row->link_image' $alt $title />";
|
$output.= "<img src='" . get_settings('siteurl') . "$row->link_image' $alt $title />";
|
||||||
} else {
|
} else {
|
||||||
echo($name);
|
$output.= $name;
|
||||||
}
|
}
|
||||||
echo('</a>');
|
|
||||||
|
$output.= '</a>';
|
||||||
|
|
||||||
if ($show_updated && $row->recently_updated) {
|
if ($show_updated && $row->recently_updated) {
|
||||||
echo get_settings('links_recently_updated_append');
|
$output.= get_settings('links_recently_updated_append');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($show_description && ($desc != '')) {
|
if ($show_description && ($desc != '')) {
|
||||||
echo($between.$desc);
|
$output.= $between.$desc;
|
||||||
}
|
}
|
||||||
echo("$after\n");
|
$output.= "$after\n";
|
||||||
} // end while
|
} // end while
|
||||||
|
|
||||||
|
if($echo) {
|
||||||
|
echo $output;
|
||||||
|
} else {
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user