Make WordPress Core

Changeset 1451


Ignore:
Timestamp:
07/06/2004 05:04:07 PM (21 years ago)
Author:
saxmatt
Message:

Missing $before from Josh Kaufman-Horner and some code cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/template-functions-general.php

    r1435 r1451  
    142142
    143143function single_month_title($prefix = '', $display = true ) {
    144     global $m, $month;
    145     if(!empty($m)) {
    146         $my_year = substr($m,0,4);
    147         $my_month = $month[substr($m,4,2)];
    148         if ($display)
    149             echo $prefix.$my_month.$prefix.$my_year;
    150         else
    151             return $m;
    152     }
     144    global $m, $month;
     145    if(!empty($m)) {
     146        $my_year = substr($m, 0, 4);
     147        $my_month = $month[substr($m, 4, 2)];
     148        if ($display)
     149            echo $prefix . $my_month . $prefix . $my_year;
     150        else
     151            return $m;
     152    }
    153153}
    154154
    155155/* link navigation hack by Orien http://icecode.com/ */
    156 function get_archives_link($url, $text, $format = "html", $before = "", $after = "") {
    157     if ('link' == $format) {
    158         return "\t".'<link rel="archives" title="'.$text.'" href="'.$url.'" />'."\n";
    159     } else if ('option' == $format) {
    160         return '<option value="'.$url.'">'.$text.'</option>'."\n";
    161     } else if ('html' == $format) {
    162         return "\t".'<li><a href="'.$url.'" title="'.$text.'">'.$text.'</a>'.$after.'</li>'."\n";
    163     } else { // custom
    164         return "\t".$before.'<a href="'.$url.'" title="'.$text.'">'.$text.'</a>'.$after."\n";
    165     }
     156function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') {
     157    $text = wptexturize($text);
     158    if ('link' == $format) {
     159        return "\t<link rel='archives' title='$text' href='$url' />\n";
     160    } elseif ('option' == $format) {
     161        return "\t<option value='$url'>$text</option>\n";
     162    } elseif ('html' == $format) {
     163        return "\t<li>$before<a href='$url' title='$text'>$text</a>$after</li>\n";
     164    } else { // custom
     165        return "\t$before<a href='$url' title='$text'>$text</a>$after\n";
     166    }
    166167}
    167168
Note: See TracChangeset for help on using the changeset viewer.