block_core_calendar_update_has_published_post_on_delete()
Handler for updating the has published posts flag when a post is deleted.
No Hooks.
Returns
null. Nothing (null).
Usage
block_core_calendar_update_has_published_post_on_delete( $post_id );
- $post_id(int) (required)
- Deleted post ID.
Changelog
| Since 5.9.0 | Introduced. |
block_core_calendar_update_has_published_post_on_delete() block core calendar update has published post on delete code WP 6.8.3
function block_core_calendar_update_has_published_post_on_delete( $post_id ) {
$post = get_post( $post_id );
if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
return;
}
block_core_calendar_update_has_published_posts();
}