Make WordPress Core


Ignore:
Timestamp:
02/21/2014 10:38:00 PM (13 years ago)
Author:
SergeyBiryukov
Message:

Remove unnecessary assignment and concatenation from the_date() and get_the_date().

props juliobox.
fixes #27181.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r27148 r27230  
    14041404function the_date( $d = '', $before = '', $after = '', $echo = true ) {
    14051405        global $currentday, $previousday;
    1406         $the_date = '';
     1406
    14071407        if ( $currentday != $previousday ) {
    1408                 $the_date .= $before;
    1409                 $the_date .= get_the_date( $d );
    1410                 $the_date .= $after;
     1408                $the_date = $before . get_the_date( $d ) . $after;
    14111409                $previousday = $currentday;
    14121410
    1413                 $the_date = apply_filters('the_date', $the_date, $d, $before, $after);
     1411                $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after );
    14141412
    14151413                if ( $echo )
     
    14351433function get_the_date( $d = '' ) {
    14361434        $post = get_post();
    1437         $the_date = '';
    14381435
    14391436        if ( '' == $d )
    1440                 $the_date .= mysql2date(get_option('date_format'), $post->post_date);
     1437                $the_date = mysql2date( get_option( 'date_format' ), $post->post_date );
    14411438        else
    1442                 $the_date .= mysql2date($d, $post->post_date);
    1443 
    1444         return apply_filters('get_the_date', $the_date, $d);
     1439                $the_date = mysql2date( $d, $post->post_date );
     1440
     1441        return apply_filters( 'get_the_date', $the_date, $d );
    14451442}
    14461443
Note: See TracChangeset for help on using the changeset viewer.