WP_Query::is_privacy_policy() WordPress Method

The WP_Query::is_privacy_policy() method is used to determine whether the current page is the Privacy Policy page.

WP_Query::is_privacy_policy() #

Is the query 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".


Top ↑

Return

(bool) Whether the query is for the Privacy Policy page.


Top ↑

Source

File: wp-includes/class-wp-query.php

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


Top ↑

Changelog

Changelog
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More