better fix for single_month_title, preserves backward-compatibility with

git-svn-id: http://svn.automattic.com/wordpress/trunk@1816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
michelvaldrighi 2004-10-18 23:52:36 +00:00
parent d6928c9df3
commit 8990d8c02f

View File

@ -216,15 +216,19 @@ function single_cat_title($prefix = '', $display = true ) {
}
function single_month_title($prefix = '', $display = true ) {
global $monthnum, $month, $year;
if(!empty($monthnum)) {
global $m, $monthnum, $month, $year;
if(!empty($monthnum) && !empty($year)) {
$my_year = $year;
$my_month = $month[$monthnum];
if ($display) {
echo $prefix . $my_month . $prefix . " " . $my_year;
} else {
return $monthnum;
}
} elseif(!empty($m)) {
$my_year = substr($m, 0, 4);
$my_month = $month[substr($m, 4, 2)];
}
if (!empty($my_month) && $display) {
echo $prefix . $my_month . $prefix . $my_year;
} else {
return $monthnum;
}
}