wpseek.com
WordPress开发者和主题制作者的搜索引擎



_reset_privacy_policy_page_for_post › WordPress Function

Since7.1.0
已弃用n/a
› _reset_privacy_policy_page_for_post ( $post_id )
访问:
  • private
参数:
  • (int) $post_id The ID of the post being deleted.
    Required: Yes
定义在:
文档:

Resets the Privacy Policy page ID option when the Privacy Policy page is permanently deleted, to prevent uncached database queries for a non-existent page.



源码

function _reset_privacy_policy_page_for_post( int $post_id ): void {
	if ( 'page' === get_post_type( $post_id ) && ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post_id ) ) {
		update_option( 'wp_page_for_privacy_policy', 0 );
	}
}