IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 3594 | 3594 | if ( mysql2date( 'U', $post_date_gmt, false ) > mysql2date( 'U', $now, false ) ) { |
| 3595 | 3595 | $post_status = 'future'; |
| 3596 | 3596 | } |
| 3597 | | } elseif ( 'future' == $post_status ) { |
| 3598 | | $now = gmdate( 'Y-m-d H:i:59' ); |
| 3599 | | if ( mysql2date( 'U', $post_date_gmt, false ) <= mysql2date( 'U', $now, false ) ) { |
| | 3597 | } elseif ( 'future' === $post_status ) { |
| | 3598 | |
| | 3599 | // String comparison to work around far future (year 2038+) scheduled on 32-bit systems. |
| | 3600 | if ( $post_date_gmt <= gmdate( 'Y-m-d H:i:59' ) ) { |
| 3600 | 3601 | $post_status = 'publish'; |
| 3601 | 3602 | } |
| 3602 | 3603 | } |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 302 | 302 | $this->assertSame( $expected, $actual ); |
| 303 | 303 | } |
| 304 | 304 | |
| | 305 | function test_scheduled_past_time_should_be_published() { |
| | 306 | |
| | 307 | $now = new DateTimeImmutable( 'now', new DateTimeZone( 'UTC' ) ); |
| | 308 | |
| | 309 | $post_id = $this->factory()->post->create( [ |
| | 310 | 'post_date_gmt' => $now->modify( '-1 year' )->format( 'Y-m-d H:i:s' ), |
| | 311 | 'post_status' => 'future', |
| | 312 | ] ); |
| | 313 | |
| | 314 | $this->assertEquals( 'publish', get_post_status( $post_id ) ); |
| | 315 | |
| | 316 | $post_id = $this->factory()->post->create( [ |
| | 317 | 'post_date_gmt' => $now->modify( '+50 years' )->format( 'Y-m-d H:i:s' ), |
| | 318 | 'post_status' => 'future', |
| | 319 | ] ); |
| | 320 | |
| | 321 | $this->assertEquals( 'future', get_post_status( $post_id ) ); |
| | 322 | } |
| 305 | 323 | } |