block_core_calendar_update_has_published_post_on_delete

The timeline below displays how wordpress function block_core_calendar_update_has_published_post_on_delete has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Handler for updating the has published posts flag when a post is deleted.
 *
 * @param int $post_id Deleted post ID.
 */
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();
}

WordPress Version: 5.9

/**
 * Handler for updating the has published posts flag when a post is deleted.
 *
 * @param int $post_id Deleted post ID.
 */
function block_core_calendar_update_has_published_post_on_delete($post_id)
{
    if (is_multisite()) {
        return;
    }
    $post = get_post($post_id);
    if (!$post || 'publish' !== $post->post_status || 'post' !== $post->post_type) {
        return;
    }
    block_core_calendar_update_has_published_posts();
}