[wp-trac] [WordPress Trac] #49264: Consider a redesign for the Policy Settings page (includes Policy Guide and future Disclosures & Policies)

WordPress Trac noreply at wordpress.org
Sun Jan 26 21:33:50 UTC 2020


#49264: Consider a redesign for the Policy Settings page (includes Policy Guide and
future Disclosures & Policies)
-------------------------------------+-------------------------------------
 Reporter:  xkon                     |       Owner:  xkon
     Type:  enhancement              |      Status:  assigned
 Priority:  normal                   |   Milestone:  Future Release
Component:  Privacy                  |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  needs-design-feedback    |     Focuses:  ui, accessibility,
  has-patch 2nd-opinion              |  administration, privacy
-------------------------------------+-------------------------------------

Comment (by xkon):

 [attachment:"49264.3.diff"] adds finishing touches to the CSS while moving
 things around to properly work (non-breaking changes) and all the main
 functionality is patched now 🙂.

 It also moves & adds any extra CSS in `common.css` to avoid creating new
 files, so it makes it non-depended on major releases only.

 Next steps:
 1. Wait for feedback.
 2. Work on the `wp_add_privacy_policy_content()` that requires a `string`
 and there have been a lot of plugins that are not adding styles, headers,
 etc correctly. I will be seeing on updating the function if possible to
 standardize a little bit how Policies can be added via an array as well
 (to keep back-compatibility also).

 With an array, we can have more control over the output HTML that will
 help to prevent false classes and headings as well as make the Copy
 actions easier.

 As an example we can have an array like:

 {{{
 <?php

 $policy = array(
         array(
                 'title'          => 'What personal data we collect and why
 we collect it',
                 'tutorial_text'  => array(
                         'Line 1',
                         'Line 2',
                         'Line 3',
                         'Line 4',
                 ),
                 'suggested_text' => array(
                         'Write this',
                         'Write this as well',
                 ),
         ),
         array(
                 'title'          => 'Embedded content from other
 websites',
                 'tutorial_text'  => array(
                         'Line 5',
                         'Line 6',
                         'Line 7',
                 ),
                 'suggested_text' => array(
                         'Write that',
                         'Write that as well',
                 ),
         ),
 );
 }}}

 And output it's contents like so:

 {{{
 foreach ( $policy as $section ) {
         echo $section['title'];
         if ( array_key_exists( 'tutorial_text', $section ) ) {
                 foreach ( $section['tutorial_text'] as $text ) {
                         echo '<p class="privacy-policy-tutorial">' . $text
 . '</p>';
                 }
         }
         if ( array_key_exists( 'suggested_text', $section ) ) {
                 echo '<p class="privacy-policy-suggested-text">' . __(
 'Suggested text:' ) . '</p>';
                 foreach ( $section['suggested_text'] as $text ) {
                         echo '<p class="privacy-policy-suggested-text">' .
 $text . '</p>';
                 }
         }
 }
 }}}

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


More information about the wp-trac mailing list