block_core_calendar_update_has_published_post_on_delete()WP 1.0

Handler for updating the has published posts flag when a post is deleted.

Хуков нет.

Возвращает

null. Ничего.

Использование

block_core_calendar_update_has_published_post_on_delete( $post_id );
$post_id(int) (обязательный)
Deleted post ID.

Код block_core_calendar_update_has_published_post_on_delete() WP 6.0.2

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();
}