Privacy: Introduce Privacy Policy page helpers:

* `is_privacy_policy()` template tag
* `privacy-policy.php` template
* `.privacy-policy` body class
* `.menu-item-privacy-policy` menu item class

Props garrett-eclipse, birgire, xkon, Clorith.
Fixes #44005.

git-svn-id: https://develop.svn.wordpress.org/trunk@44966 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-03-21 19:47:29 +00:00
parent 49d8c2590c
commit 65bd3654cc
14 changed files with 250 additions and 7 deletions

View File

@@ -1590,4 +1590,24 @@ class Tests_Query_Conditionals extends WP_UnitTestCase {
$this->assertTrue( is_single( $p2 ) );
$this->assertFalse( is_single( $p1 ) );
}
/**
* @ticket 44005
* @group privacy
*/
public function test_is_privacy_policy() {
$page_id = self::factory()->post->create(
array(
'post_type' => 'page',
'post_title' => 'Privacy Policy',
)
);
update_option( 'wp_page_for_privacy_policy', $page_id );
$this->go_to( get_permalink( $page_id ) );
$this->assertQueryTrue( 'is_page', 'is_singular', 'is_privacy_policy' );
}
}