From 68f4f9d5ba714e8d5d43f3fbc852435a2f032ffd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 21 Feb 2014 22:38:13 +0000 Subject: [PATCH] Remove unnecessary assignment and concatenation from the_date() and get_the_date(). props juliobox. fixes #27181. Built from https://develop.svn.wordpress.org/trunk@27230 git-svn-id: http://core.svn.wordpress.org/trunk@27087 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 5eb3e3dc3a..cb61c58ad2 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1403,14 +1403,12 @@ function the_date_xml() { */ function the_date( $d = '', $before = '', $after = '', $echo = true ) { global $currentday, $previousday; - $the_date = ''; + if ( $currentday != $previousday ) { - $the_date .= $before; - $the_date .= get_the_date( $d ); - $the_date .= $after; + $the_date = $before . get_the_date( $d ) . $after; $previousday = $currentday; - $the_date = apply_filters('the_date', $the_date, $d, $before, $after); + $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after ); if ( $echo ) echo $the_date; @@ -1434,14 +1432,13 @@ function the_date( $d = '', $before = '', $after = '', $echo = true ) { */ function get_the_date( $d = '' ) { $post = get_post(); - $the_date = ''; if ( '' == $d ) - $the_date .= mysql2date(get_option('date_format'), $post->post_date); + $the_date = mysql2date( get_option( 'date_format' ), $post->post_date ); else - $the_date .= mysql2date($d, $post->post_date); + $the_date = mysql2date( $d, $post->post_date ); - return apply_filters('get_the_date', $the_date, $d); + return apply_filters( 'get_the_date', $the_date, $d ); } /**