[wp-trac] [WordPress Trac] #44005: Introduce Privacy Policy Page helpers; is_privacy_policy() query function, privacy-policy body class, privacy-policy.php template and .menu-item-privacy-policy menu item class (was: Privacy template file)

WordPress Trac noreply at wordpress.org
Wed Mar 13 10:39:05 UTC 2019


#44005: Introduce Privacy Policy Page helpers; is_privacy_policy() query function,
privacy-policy body class, privacy-policy.php template and .menu-item-
privacy-policy menu item class
-------------------------------------------------+-------------------------
 Reporter:  Clorith                              |       Owner:  garrett-
                                                 |  eclipse
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.2
Component:  Privacy                              |     Version:  4.9.6
 Severity:  normal                               |  Resolution:
 Keywords:  needs-testing has-patch has-unit-    |     Focuses:  template,
  tests dev-feedback                             |  privacy
-------------------------------------------------+-------------------------
Changes (by garrett-eclipse):

 * keywords:  needs-testing has-patch has-unit-tests => needs-testing has-
     patch has-unit-tests dev-feedback


Comment:

 @birgire & @xkon while going through this I realized we should add
 coverage for the menu item when it's the Privacy Policy Page.

 I've uploaded
 [https://core.trac.wordpress.org/attachment/ticket/44005/44005.5.diff
 44005.5.diff] to add the `.menu-item-privacy-policy` class to the menu
 item if it's the current Privacy Policy Page.

 I also added two unit tests to follow the `front_page` versions of the
 menu item class tests.
 `test_no_privacy_policy_class_applied` - Confirms the class isn't added
 when not wanted
 `test_class_applied_to_privacy_policy_page_item` - Confirms the class is
 added when the Privacy Policy Page is the menu item.

 With this addition this ticket now introduces;
 - `is_privacy_policy()` query function
 - `privacy-policy` body class
 - `privacy-policy.php` template file
 - `.menu-item-privacy-policy` menu item class
 *Adjusted title accordingly.

 The tests are passing successfully for me and all the above is functioning
 properly in manual testing. Would love some additional testing and
 feedback and feel we can move this forward to get committer feedback
 (added `dev-feedback` for that).

 To me this seems to warrant possibly `needs-docs`, `needs-codex` and
 `needs-dev-note` keywords as it introduces new classes, template hierarchy
 and query support.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44005#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list