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



_reset_privacy_policy_page_for_post › WordPress Function

Since7.1.0
Deprecatedn/a
_reset_privacy_policy_page_for_post ( $post_id )
Access:
  • private
Parameters:
  • (int) $post_id The ID of the post being deleted.
    Required: Yes
Defined at:
Codex:

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.



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