#3300 closed defect (bug) (wontfix)
Problems with get_archives_link()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.0.4 |
| Component: | Template | Keywords: | |
| Focuses: | Cc: |
Description
Some anchor rewriting plugins (like Click Counter, http://frenchfragfactory.net/ozh/archives/2004/09/17/click-counter-plugin-for-wordpress/ ) are having problems with the following function found in the wp-includes/template-functions-general.php script:
/* link navigation hack by Orien http://icecode.com/ */
function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
$text = wptexturize($text);
$title_text = wp_specialchars($text, 1);
if ('link' == $format)
return "\t<link rel='archives' title='$title_text' href='$url' />\n";
elseif ('option' == $format)
return "\t<option value='$url'>$before $text $after</option>\n";
elseif ('html' == $format)
return "\t<li>$before<a href='$url' title='$title_text'>$text</a>$after</li>\n";
else // custom
return "\t$before<a href='$url' title='$title_text'>$text</a>$after\n";
}
Could you replace double quotes with single quotes and viceversa in the "return" statements like in the rest of the script ?
Correct code:
/* link navigation hack by Orien http://icecode.com/ */
function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
$text = wptexturize($text);
$title_text = wp_specialchars($text, 1);
if ('link' == $format)
return "\t".'<link rel="archives" title="'.$title_text.' href="'.$url.'" />'."\n";
elseif ('option' == $format)
return "\t".'<option value="'.$url.'">'.$before.' '.$text.' '.$after.'</option>'."\n";
elseif ('html' == $format)
return "\t".'<li>'.$before.'<a href="'.$url.'" title="'.$title_text.'">'.$text.'</a>'.$after.'</li>'."\n";
else // custom
return "\t".$before.'<a href="'.$url.'" title="'.$title_text.'">'.$text.'</a>'.$after."\n";
}
Change History (6)
#2
@
19 years ago
If I use the KG Archives plugin http://www.katesgasis.com/2005/05/01/kg-archives-plugin/, which calls the get_archives_link() function, all links in the Archive section break when the Click Counter plugin is active. With my proposed code, they don't.
Note: See
TracTickets for help on using
tickets.
I use that plugin on my site and I don't seem to be having any problems...