Make WordPress Core


Ignore:
Timestamp:
03/21/2019 07:47:29 PM (6 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query/conditionals.php

    r43571 r44966  
    15911591        $this->assertFalse( is_single( $p1 ) );
    15921592    }
     1593   
     1594    /**
     1595     * @ticket 44005
     1596     * @group privacy
     1597     */
     1598    public function test_is_privacy_policy() {
     1599        $page_id = self::factory()->post->create(
     1600            array(
     1601                'post_type'  => 'page',
     1602                'post_title' => 'Privacy Policy',
     1603            )
     1604        );
     1605
     1606        update_option( 'wp_page_for_privacy_policy', $page_id );
     1607
     1608        $this->go_to( get_permalink( $page_id ) );
     1609
     1610        $this->assertQueryTrue( 'is_page', 'is_singular', 'is_privacy_policy' );
     1611    }
     1612
    15931613}
Note: See TracChangeset for help on using the changeset viewer.