Remove unnecessary assignment and concatenation from the_date() and get_the_date().
props juliobox. fixes #27181. git-svn-id: https://develop.svn.wordpress.org/trunk@27230 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1ab5043e7f
commit
fdb9451326
|
@ -1403,14 +1403,12 @@ function the_date_xml() {
|
||||||
*/
|
*/
|
||||||
function the_date( $d = '', $before = '', $after = '', $echo = true ) {
|
function the_date( $d = '', $before = '', $after = '', $echo = true ) {
|
||||||
global $currentday, $previousday;
|
global $currentday, $previousday;
|
||||||
$the_date = '';
|
|
||||||
if ( $currentday != $previousday ) {
|
if ( $currentday != $previousday ) {
|
||||||
$the_date .= $before;
|
$the_date = $before . get_the_date( $d ) . $after;
|
||||||
$the_date .= get_the_date( $d );
|
|
||||||
$the_date .= $after;
|
|
||||||
$previousday = $currentday;
|
$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 )
|
if ( $echo )
|
||||||
echo $the_date;
|
echo $the_date;
|
||||||
|
@ -1434,14 +1432,13 @@ function the_date( $d = '', $before = '', $after = '', $echo = true ) {
|
||||||
*/
|
*/
|
||||||
function get_the_date( $d = '' ) {
|
function get_the_date( $d = '' ) {
|
||||||
$post = get_post();
|
$post = get_post();
|
||||||
$the_date = '';
|
|
||||||
|
|
||||||
if ( '' == $d )
|
if ( '' == $d )
|
||||||
$the_date .= mysql2date(get_option('date_format'), $post->post_date);
|
$the_date = mysql2date( get_option( 'date_format' ), $post->post_date );
|
||||||
else
|
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue