[wp-trac] [WordPress Trac] #42088: Function to detect if current page is a scheduled post (is_scheduled() or is_future())
WordPress Trac
noreply at wordpress.org
Wed Oct 4 17:52:46 UTC 2017
#42088: Function to detect if current page is a scheduled post (is_scheduled() or
is_future())
---------------------------+-----------------------------
Reporter: paulschreiber | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.8.2
Severity: normal | Keywords:
Focuses: |
---------------------------+-----------------------------
It would be very helpful if there was a function to detect if the page
being viewed is a scheduled post. Call this is_scheduled() or is_future().
Currently, you can achieve this check with code link this:
{{{#!php
<?php
function is_scheduled() {
global $post;
$is_future = 'future' === $post->post_status;
return ( is_preview() && $is_future );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42088>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list