Make WordPress Core


Ignore:
Timestamp:
10/18/2004 11:52:36 PM (22 years ago)
Author:
michelvaldrighi
Message:

better fix for single_month_title, preserves backward-compatibility with

File:
1 edited

Legend:

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

    r1815 r1816  
    217217
    218218function single_month_title($prefix = '', $display = true ) {
    219         global $monthnum, $month, $year;
    220         if(!empty($monthnum)) {
     219        global $m, $monthnum, $month, $year;
     220        if(!empty($monthnum) && !empty($year)) {
    221221                $my_year = $year;
    222222                $my_month = $month[$monthnum];
    223                 if ($display) {
    224                         echo $prefix . $my_month . $prefix . " " . $my_year;
    225                 } else {
    226                         return $monthnum;
    227                 }
     223        } elseif(!empty($m)) {
     224                $my_year = substr($m, 0, 4);
     225                $my_month = $month[substr($m, 4, 2)];
     226        }
     227
     228        if (!empty($my_month) && $display) {
     229                echo $prefix . $my_month . $prefix . $my_year;
     230        } else {
     231                return $monthnum;
    228232        }
    229233}
Note: See TracChangeset for help on using the changeset viewer.