Return after echoing cached calendar. Fixes double output. Props mtdewvirus. fixes #13077

git-svn-id: https://develop.svn.wordpress.org/trunk@14183 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-04-21 21:35:39 +00:00
parent dcdde9cb36
commit 3479e68ff8
1 changed files with 4 additions and 2 deletions

View File

@ -1061,10 +1061,12 @@ function get_calendar($initial = true, $echo = true) {
$key = md5( $m . $monthnum . $year );
if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {
if ( is_array($cache) && isset( $cache[ $key ] ) ) {
if ( $echo )
if ( $echo ) {
echo apply_filters( 'get_calendar', $cache[$key] );
else
return;
} else {
return apply_filters( 'get_calendar', $cache[$key] );
}
}
}