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
| Version | Description |
|---|---|
| 7.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.