wpseek.com
A WordPress-centric search engine for devs and theme authors



block_core_calendar_update_has_published_post_on_delete › WordPress Function

Sincen/a
Deprecatedn/a
block_core_calendar_update_has_published_post_on_delete ( $post_id )
Parameters:
  • (int) $post_id Deleted post ID.
    Required: Yes
Defined at:
Codex:

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



Source

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