WP_Query::is_privacy_policy(): bool

In this article

Determines whether the query is for the Privacy Policy page.

Description

This is the page which shows the Privacy Policy content of your site.

Depends on the site’s "Change your Privacy Policy page" Privacy Settings ‘wp_page_for_privacy_policy’.

This function will return true only on the page you set as the "Privacy Policy page".

Return

bool Whether the query is for the Privacy Policy page.

Source

public function is_privacy_policy() {
	if ( get_option( 'wp_page_for_privacy_policy' )
		&& $this->is_page( get_option( 'wp_page_for_privacy_policy' ) )
	) {
		return true;
	} else {
		return false;
	}
}

Changelog

VersionDescription
5.2.0Introduced.

User Contributed Notes

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