Countdown for Scheduled Posts in Admin Lists
Shows how long until each scheduled post goes live, such as "in 3 hours", next to the date in admin lists, so the publishing queue is easy to read.
Opens WPIDE on
Code
add_filter( 'post_date_column_status', function ( $status, $post ) {
if ( 'future' !== $post->post_status ) {
return $status;
}
$time = get_post_time( 'U', true, $post );
if ( $time <= time() ) {
return $status . '<br><span style="color:#b32d2e">missed schedule</span>';
}
return $status . '<br><span style="color:#2271b1">in ' . esc_html( human_time_diff( $time ) ) . '</span>';
}, 10, 2 );
Notes
Posts whose scheduled time has already passed get a red "missed schedule" label.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.