mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
d6928c9df3
commit
8990d8c02f
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user