Opened 9 years ago
Closed 12 months ago
#42088 closed enhancement (maybelater)
Function to detect if current page is a scheduled post (is_scheduled() or is_future())
| Reported by: | paulschreiber | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.