Add a dashboard widget listing the next 10 scheduled posts, with their publish dates and edit links.
add_action( 'wp_dashboard_setup', function (): void {
if ( ! current_user_can( 'edit_posts' ) ) {
return;
}
wp_add_dashboard_widget( 'nahnu_scheduled_posts', 'Scheduled posts', function (): void {
$posts = get_posts( [
'post_status' => 'future',
'post_type' => 'any',
'posts_per_page' => 10,
'orderby' => 'date',
'order' => 'ASC',
] );
if ( ! $posts ) {
echo '<p>Nothing scheduled.</p>';
return;
}
echo '<ul>';
foreach ( $posts as $post ) {
printf(
'<li><a href="%s">%s</a> <span style="color:#6B6680">%s</span></li>',
esc_url( get_edit_post_link( $post ) ),
esc_html( get_the_title( $post ) ?: '(no title)' ),
esc_html( get_the_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $post ) )
);
}
echo '</ul>';
} );
} );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
The Posts list mixes scheduled posts with everything else. For a content calendar at a glance, this snippet lists what’s coming up next right on the dashboard.
wp_add_dashboard_widget() registers the widget for anyone who can edit posts. It fetches the next 10 posts of any type with the future status, ordered by publish date, and shows each title with its date and time in your site’s formats, linked to the editor.
Schedule a post for tomorrow, then open the dashboard. It should appear in the Scheduled posts widget.