_reset_privacy_policy_page_for_post( int $post_id )

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

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.

Parameters

$post_idintrequired
The ID of the post being deleted.

Source

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

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.