Make WordPress Core


Ignore:
Timestamp:
02/07/2023 02:03:26 PM (3 years ago)
Author:
audrasjb
Message:

Privacy: Add rel="privacy-policy" to the Privacy Policy link.

This changeset adds a rel="privacy-policy" attribute to user-facing links to the Privacy Policy of the website, when a privacy policy page is set and available. While this rel value is still a RFC of the Link Types HTML specification, this changeset helps to make Privacy Policy link more discoverable for user agents and HTML parsers.

Props dshanske, audrasjb, bhavz-10, bookwyrm, faisal03, JeffPaul, peterwilsoncc, paapst, davidbaumwald, costdev, robinwpdeveloper, kawserz.
Fixes #56345.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/link/getThePrivacyPolicyLink.php

    r54090 r55261  
    161161        return 'Policy: ' . $privacy_policy_url;
    162162    }
     163
     164    /**
     165     * Tests that `get_the_privacy_policy_link()` adds `rel="privacy-policy"`.
     166     *
     167     * @ticket 56345
     168     */
     169    public function test_get_the_privacy_policy_link_should_add_rel_privacy_policy() {
     170        update_option( 'wp_page_for_privacy_policy', self::$privacy_policy_page_id );
     171
     172        $this->assertStringContainsString( 'rel="privacy-policy"', get_the_privacy_policy_link() );
     173    }
    163174}
Note: See TracChangeset for help on using the changeset viewer.