block_core_calendar_update_has_published_post_on_delete

函数
block_core_calendar_update_has_published_post_on_delete ( $post_id )

block_core_calendar_update_has_published_post_on_delete: 当一个文章被删除时,这个函数用来更新指定日期的has_published_posts元值。它需要一个文章的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();
	}

	/**
	 * Handler for updating the has published posts flag when a post status changes.
	 *
	 * @param string  $new_status The status the post is changing to.
	 * @param string  $old_status The status the post is changing from.
	 * @param WP_Post $post       Post object.
	 */

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-14 16:36:35

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: