WordPress.org

Make WordPress Core

Ticket #13945: 13945.diff

File 13945.diff, 2.5 KB (added by prettyboymp, 8 years ago)
  • wp-includes/functions.php

     
    13211321 * @return int 1 when new day, 0 if not a new day.
    13221322 */
    13231323function is_new_day() {
    1324         global $day, $previousday;
    1325         if ( $day != $previousday )
     1324        global $currentday, $previousday;
     1325        if ( $currentday != $previousday )
    13261326                return 1;
    13271327        else
    13281328                return 0;
  • wp-includes/query.php

     
    28442844 * @return bool True when finished.
    28452845 */
    28462846function setup_postdata($post) {
    2847         global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages;
     2847        global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
    28482848
    28492849        $id = (int) $post->ID;
    28502850
    28512851        $authordata = get_userdata($post->post_author);
    28522852
    2853         $day = mysql2date('d.m.y', $post->post_date, false);
     2853        $currentday = mysql2date('d.m.y', $post->post_date, false);
    28542854        $currentmonth = mysql2date('m', $post->post_date, false);
    28552855        $numpages = 1;
    28562856        $page = get_query_var('page');
  • wp-includes/general-template.php

     
    13341334 * @return string|null Null if displaying, string if retrieving.
    13351335 */
    13361336function the_date( $d = '', $before = '', $after = '', $echo = true ) {
    1337         global $day, $previousday;
     1337        global $currentday, $previousday;
    13381338        $the_date = '';
    1339         if ( $day != $previousday ) {
     1339        if ( $currentday != $previousday ) {
    13401340                $the_date .= $before;
    13411341                $the_date .= get_the_date( $d );
    13421342                $the_date .= $after;
    1343                 $previousday = $day;
     1343                $previousday = $currentday;
    13441344
    13451345                $the_date = apply_filters('the_date', $the_date, $d, $before, $after);
    13461346
     
    15461546function the_weekday_date($before='',$after='') {
    15471547        global $wp_locale, $post, $day, $previousweekday;
    15481548        $the_weekday_date = '';
    1549         if ( $day != $previousweekday ) {
     1549        if ( $currentday != $previousweekday ) {
    15501550                $the_weekday_date .= $before;
    15511551                $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false));
    15521552                $the_weekday_date .= $after;
    1553                 $previousweekday = $day;
     1553                $previousweekday = $currentday;
    15541554        }
    15551555        $the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after);
    15561556        echo $the_weekday_date;