Opened 8 years ago
Closed 2 months ago
#42088 closed enhancement (maybelater)
Function to detect if current page is a scheduled post (is_scheduled() or is_future())
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Posts, Post Types | Keywords: | |
| Focuses: | Cc: |
Description
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 function is_scheduled() { global $post; $is_future = 'future' === $post->post_status; return ( is_preview() && $is_future ); }
Change History (3)
Note: See
TracTickets for help on using
tickets.
It seems that after 8 years, this hasn't had much traction
Also, we could be using
if ( get_post_status() === ‘future’)since$postcan be omitted in the loop.I am not sure how this function will be much more useful, feels redundant and doesn't provide a lot of value.
I'm closing this as
maybelater, in case there is more interest, but I seriously doubt this should be ever implemented.