From c5923e342ddadd36359d22ffed2a75784e87e682 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 5 Oct 2006 03:12:24 +0000 Subject: [PATCH] fix usage of $m and return behavior in single_month_title(). fixes #3207 git-svn-id: https://develop.svn.wordpress.org/trunk@4346 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/general-template.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 063407e543..e5c9021be6 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -260,13 +260,17 @@ function single_month_title($prefix = '', $display = true ) { $my_month = $wp_locale->get_month($monthnum); } elseif ( !empty($m) ) { $my_year = substr($m, 0, 4); - $my_month = $wp_locale->get_month($m); + $my_month = $wp_locale->get_month(substr($m, 4, 2)); } - if ( !empty($my_month) && $display ) - echo $prefix . $my_month . $prefix . $my_year; - else - return $monthnum; + if ( empty($my_month) ) + return false; + + $result = $prefix . $my_month . $prefix . $my_year; + + if ( !$display ) + return $result; + echo $result; }