Make WordPress Core


Ignore:
Timestamp:
05/23/2019 12:37:56 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Date/Time: Return early from the_weekday() and the_weekday_date() if we're not in the loop.

Restore $previousweekday global usage in the_weekday_date(), so it could still be used simultaneously with the_date().

Partially reverts [45378].
See #47354.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/date/theDate.php

    r45378 r45379  
    139139
    140140        ob_start();
    141         $GLOBALS['currentday']  = '18.09.15';
    142         $GLOBALS['previousday'] = '17.09.15';
     141        $GLOBALS['currentday']      = '18.09.15';
     142        $GLOBALS['previousweekday'] = '17.09.15';
    143143        the_weekday_date();
    144144        $this->assertEquals( 'Wednesday', ob_get_clean() );
    145145
    146146        ob_start();
    147         $GLOBALS['currentday']  = '18.09.15';
    148         $GLOBALS['previousday'] = '17.09.15';
     147        $GLOBALS['currentday']      = '18.09.15';
     148        $GLOBALS['previousweekday'] = '17.09.15';
    149149        the_weekday_date( 'before ', ' after' );
    150150        $this->assertEquals( 'before Wednesday after', ob_get_clean() );
Note: See TracChangeset for help on using the changeset viewer.