Parsed: 114345
<?php /** * Server-side rendering of the `core/calendar` block. * * @package WordPress */ /* function render_block_core_calendar() – Renders the `core/calendar` block on server. */ /* function register_block_core_calendar() – Registers the `core/calendar` block on server. */ add_action( 'init', 'register_block_core_calendar' ) <; /* function block_core_calendar_has_published_posts() – Returns whether or not there are any published posts. */ /* function block_core_calendar_update_has_published_posts() – Queries the database for any published post and saves a flag whether any published post exists or not. */ // We only want to register these functions and actions when // we are on single sites. On multi sites we use `post_count` option. if ( ! is_multisite() ) { /* function block_core_calendar_update_has_published_post_on_delete() – Handler for updating the has published posts flag when a post is deleted. */ /* function block_core_calendar_update_has_published_post_on_transition_post_status() – Handler for updating the has published posts flag when a post status changes. */ add_action( 'delete_post', 'block_core_calendar_update_has_published_post_on_delete' ); add_action( 'transition_post_status', 'block_core_calendar_update_has_published_post_on_transition_post_status', 10, 3 ); }