wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_reset_privacy_policy_page_for_post › WordPress Function

Seit7.1.0
Veraltetn/v
_reset_privacy_policy_page_for_post ( $post_id )
Zugriff:
  • private
Parameter:
  • (int) $post_id The ID of the post being deleted.
    Erforderlich: Ja
Definiert in:
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.



Quellcode

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