Make WordPress Core


Ignore:
Timestamp:
02/02/2021 08:12:39 PM (4 years ago)
Author:
TimothyBlynJacobs
Message:

Privacy: Redesign the Privacy settings pages.

The Privacy settings pages now use the same design patterns as the Site Health screen. Additionally, each privacy policy guide is now contained in an accordion to make the page easier to navigate when multiple plugins are in use.

Props xkon, hedgefield, garrett-eclipse, hellofromTonya, paaljoachim, joedolson.
Fixes #49264.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/privacy-policy-guide.php

    r49090 r50161  
    1818}
    1919
    20 $title = __( 'Privacy Policy Guide' );
     20add_filter(
     21    'admin_body_class',
     22    function( $body_class ) {
     23        $body_class .= ' privacy-settings ';
     24
     25        return $body_class;
     26    }
     27);
    2128
    2229wp_enqueue_script( 'privacy-tools' );
     
    2532
    2633?>
    27 <div class="wrap">
    28     <h1><?php echo esc_html( $title ); ?></h1>
     34<div class="privacy-settings-header">
     35    <div class="privacy-settings-title-section">
     36        <h1>
     37            <?php _e( 'Privacy' ); ?>
     38        </h1>
     39    </div>
    2940
    30     <div class="wp-privacy-policy-guide">
     41    <nav class="privacy-settings-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
     42        <a href="<?php echo esc_url( admin_url( 'options-privacy.php' ) ); ?>" class="privacy-settings-tab">
     43            <?php
     44            /* translators: Tab heading for Site Health Status page. */
     45            _ex( 'Settings', 'Privacy Settings' );
     46            ?>
     47        </a>
     48
     49        <a href="<?php echo esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); ?>" class="privacy-settings-tab active" aria-current="true">
     50            <?php
     51            /* translators: Tab heading for Site Health Status page. */
     52            _ex( 'Policy Guide', 'Privacy Settings' );
     53            ?>
     54        </a>
     55    </nav>
     56</div>
     57
     58<hr class="wp-header-end">
     59
     60<div class="notice notice-error hide-if-js">
     61    <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p>
     62</div>
     63
     64<div class="privacy-settings-body hide-if-no-js">
     65    <h2><?php _e( 'Privacy Policy Guide' ); ?></h2>
     66    <h3 class="section-title"><?php _e( 'Introduction' ); ?></h3>
     67    <p><?php _e( 'This text template will help you to create your web site&#8217;s privacy policy.' ); ?></p>
     68    <p><?php _e( 'We have suggested the sections you will need. Under each section heading you will find a short summary of what information you should provide, which will help you to get started. Some sections include suggested policy content, others will have to be completed with information from your theme and plugins.' ); ?></p>
     69    <p><?php _e( 'Please edit your privacy policy content, making sure to delete the summaries, and adding any information from your theme and plugins. Once you publish your policy page, remember to add it to your navigation menu.' ); ?></p>
     70    <p><?php _e( 'It is your responsibility to write a comprehensive privacy policy, to make sure it reflects all national and international legal requirements on privacy, and to keep your policy current and accurate.' ); ?></p>
     71    <div class="privacy-settings-accordion">
     72        <h4 class="privacy-settings-accordion-heading">
     73            <button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-privacy-policy-guide" type="button">
     74                <span class="title"><?php _e( 'Privacy Policy Guide' ); ?></span>
     75                <span class="icon"></span>
     76            </button>
     77        </h4>
     78        <div id="privacy-settings-accordion-block-privacy-policy-guide" class="privacy-settings-accordion-panel" hidden="hidden">
     79            <?php
     80            $content = WP_Privacy_Policy_Content::get_default_content( true, false );
     81            echo $content;
     82            ?>
     83        </div>
     84    </div>
     85    <hr class="hr-separator">
     86    <h3 class="section-title"><?php _e( 'Policies' ); ?></h3>
     87    <div class="privacy-settings-accordion wp-privacy-policy-guide">
    3188        <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>
    3289    </div>
Note: See TracChangeset for help on using the changeset viewer.