WordPress.org

Make WordPress Core

Ticket #49264: 49264.5.diff

File 49264.5.diff, 51.9 KB (added by xkon, 2 months ago)
  • src/js/_enqueues/admin/privacy-tools.js

    diff --git a/src/js/_enqueues/admin/privacy-tools.js b/src/js/_enqueues/admin/privacy-tools.js
    index 802ec88f4b..ee8dabf0ba 100644
    a b jQuery( document ).ready( function( $ ) { 
    7777
    7878                        appendResultsAfterRow( $requestRow, 'notice-success', summaryMessage, [] );
    7979                        $this.hide();
    80                        
     80
    8181                        if ( 'undefined' !== typeof zipUrl ) {
    8282                                window.location = zipUrl;
    8383                        } else if ( ! sendAsEmail ) {
    jQuery( document ).ready( function( $ ) { 
    259259                        }
    260260                }
    261261        });
     262
     263        /**
     264         * Handle the new JS for the revamped Policy Settings
     265         */
     266        $( 'body.options-privacy-php label[for=create-page]' ).on( 'click', function( e ) {
     267                e.preventDefault();
     268                $( 'input#create-page' ).focus();
     269        } );
     270
     271        // Accordion handling in various areas.
     272        $( '.privacy-settings-accordion' ).on( 'click', '.privacy-settings-accordion-trigger', function() {
     273                var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) );
     274
     275                if ( isExpanded ) {
     276                        $( this ).attr( 'aria-expanded', 'false' );
     277                        $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', true );
     278                } else {
     279                        $( this ).attr( 'aria-expanded', 'true' );
     280                        $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', false );
     281                }
     282        } );
    262283});
    263284
  • src/wp-admin/css/common.css

    diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css
    index a8b8112b00..d2cd6e1f44 100644
    a b img { 
    40644064                text-align: left;
    40654065        }
    40664066}
     4067
     4068/**
     4069* Privacy Settings section
     4070*/
     4071
     4072/* General */
     4073.privacy-settings #wpcontent,
     4074.privacy-settings.auto-fold #wpcontent {
     4075        padding-left: 0;
     4076}
     4077
     4078.privacy-settings-header h1 {
     4079        display: inline-block;
     4080        font-weight: 600;
     4081        margin: 0 0.8rem 1rem;
     4082        font-size: 23px;
     4083        padding: 9px 0 4px 0;
     4084        line-height: 1.3;
     4085}
     4086
     4087/* Header */
     4088.privacy-settings-header {
     4089        text-align: center;
     4090        margin: 0 0 1rem;
     4091        background: #fff;
     4092        border-bottom: 1px solid #e2e4e7;
     4093}
     4094
     4095.privacy-settings-title-section {
     4096        display: flex;
     4097        align-items: center;
     4098        justify-content: center;
     4099        clear: both;
     4100}
     4101
     4102.privacy-settings-tabs-wrapper {
     4103        /* IE 11 */
     4104        display: -ms-inline-grid;
     4105        -ms-grid-columns: 1fr 1fr;
     4106        vertical-align: top;
     4107        /* modern browsers */
     4108        display: inline-grid;
     4109        grid-template-columns: 1fr 1fr;
     4110}
     4111
     4112.privacy-settings-tab {
     4113        display: block; /* IE 11 */
     4114        text-decoration: none;
     4115        color: inherit;
     4116        padding: 0.5rem 1rem 1rem;
     4117        margin: 0 1rem;
     4118        transition: box-shadow 0.5s ease-in-out;
     4119}
     4120
     4121.privacy-settings-tab:nth-child(1) {
     4122        -ms-grid-column: 1; /* IE 11 */
     4123}
     4124
     4125.privacy-settings-tab:nth-child(2) {
     4126        -ms-grid-column: 2; /* IE 11 */
     4127}
     4128
     4129.privacy-settings-tab:focus {
     4130        color: #191e23;
     4131        outline: 1px solid #6c7781;
     4132        box-shadow: none;
     4133}
     4134
     4135.privacy-settings-tab.active {
     4136        box-shadow: inset 0 -3px #007cba;
     4137        font-weight: 600;
     4138}
     4139
     4140/* Body */
     4141.privacy-settings-body {
     4142        max-width: 800px;
     4143        margin: 0 auto;
     4144}
     4145
     4146.tools-privacy-policy-page th {
     4147        min-width: 230px;
     4148}
     4149
     4150.hr-separator {
     4151        margin-top: 20px;
     4152        margin-bottom: 15px;
     4153}
     4154
     4155/* Accordions */
     4156.privacy-settings-accordion {
     4157        border: 1px solid #ccd0d4;
     4158}
     4159
     4160.privacy-settings-accordion-heading {
     4161        margin: 0;
     4162        border-top: 1px solid #ccd0d4;
     4163        font-size: inherit;
     4164        line-height: inherit;
     4165        font-weight: 600;
     4166        color: inherit;
     4167}
     4168
     4169.privacy-settings-accordion-heading:first-child {
     4170        border-top: none;
     4171}
     4172
     4173.privacy-settings-accordion-trigger {
     4174        background: #fff;
     4175        border: 0;
     4176        color: #32373c;
     4177        cursor: pointer;
     4178        display: flex;
     4179        font-weight: 400;
     4180        margin: 0;
     4181        padding: 1em 3.5em 1em 1.5em;
     4182        min-height: 46px;
     4183        position: relative;
     4184        text-align: left;
     4185        width: 100%;
     4186        align-items: center;
     4187        justify-content: space-between;
     4188}
     4189
     4190.privacy-settings-accordion-trigger:hover,
     4191.privacy-settings-accordion-trigger:active {
     4192        background: #f8f9f9;
     4193}
     4194
     4195.privacy-settings-accordion-trigger:focus {
     4196        color: #191e23;
     4197        border: none;
     4198        box-shadow: none;
     4199        outline-offset: -1px;
     4200        outline: 2px solid #0071a1;
     4201        background-color: #f8f9f9;
     4202}
     4203
     4204.privacy-settings-accordion-trigger .title {
     4205        pointer-events: none;
     4206        font-weight: 600;
     4207        flex-grow: 1;
     4208}
     4209
     4210.privacy-settings-accordion-trigger .icon,
     4211.privacy-settings-view-read .icon {
     4212        border: solid #555d66;
     4213        border-width: 0 2px 2px 0;
     4214        height: 0.5rem;
     4215        pointer-events: none;
     4216        position: absolute;
     4217        right: 1.5em;
     4218        top: 50%;
     4219        transform: translateY(-70%) rotate(45deg);
     4220        width: 0.5rem;
     4221}
     4222
     4223.privacy-settings-accordion-trigger .badge {
     4224        padding: 0.1rem 0.5rem 0.15rem;
     4225        color: #32373c;
     4226        font-weight: 600;
     4227        margin-left: 0.5rem;
     4228}
     4229
     4230.privacy-settings-accordion-trigger .badge.blue {
     4231        border: 1px solid #bfe7f3;
     4232}
     4233
     4234.privacy-settings-accordion-trigger .badge.orange {
     4235        border: 1px solid #ffb900;
     4236}
     4237
     4238.privacy-settings-accordion-trigger .badge.red {
     4239        border: 1px solid #dc3232;
     4240}
     4241
     4242.privacy-settings-accordion-trigger .badge.green {
     4243        border: 1px solid #46b450;
     4244}
     4245
     4246.privacy-settings-accordion-trigger .badge.purple {
     4247        border: 1px solid #826eb4;
     4248}
     4249
     4250.privacy-settings-accordion-trigger .badge.gray {
     4251        border: 1px solid #ccd0d4;
     4252}
     4253
     4254.privacy-settings-accordion-trigger[aria-expanded="true"] .icon,
     4255.privacy-settings-view-passed[aria-expanded="true"] .icon {
     4256        transform: translateY(-30%) rotate(-135deg)
     4257}
     4258
     4259.privacy-settings-accordion-panel {
     4260        margin: 0;
     4261        padding: 1em 1.5em;
     4262        background: #fff;
     4263}
     4264
     4265.privacy-settings-accordion-panel[hidden] {
     4266        display: none;
     4267}
     4268
     4269.privacy-settings-accordion-panel a .dashicons {
     4270        text-decoration: none;
     4271}
     4272
     4273.privacy-settings-accordion-actions {
     4274        text-align: right;
     4275        display: block;
     4276}
     4277
     4278/* Suggested text for privacy policy */
     4279.privacy-settings-accordion-panel .privacy-policy-suggested-text-header {
     4280        font-weight: 600;
     4281        margin-bottom: 10px;
     4282}
     4283
     4284.privacy-settings-accordion-panel .privacy-policy-suggested-text {
     4285        margin: 0;
     4286        padding: 10px;
     4287        border-left: 2px solid gray;
     4288}
     4289
     4290
     4291/* Media queries */
     4292@media screen and (max-width: 782px) {
     4293
     4294        .privacy-settings-body {
     4295                margin: 0 12px;
     4296                width: auto;
     4297        }
     4298
     4299        .privacy-settings .notice {
     4300                margin: 5px 10px 15px;
     4301        }
     4302
     4303        .privacy-settings .update-nag {
     4304                margin-right: 10px;
     4305                margin-left: 10px;
     4306        }
     4307
     4308        input#create-page {
     4309                margin-top: 10px;
     4310        }
     4311}
     4312
     4313@media only screen and (max-width: 1004px) {
     4314
     4315        .privacy-settings-body {
     4316                margin: 0 22px;
     4317                width: auto;
     4318        }
     4319}
     4320
     4321/**
     4322* End Privacy Settings section
     4323*/
  • src/wp-admin/css/edit.css

    diff --git a/src/wp-admin/css/edit.css b/src/wp-admin/css/edit.css
    index bfe6dc7c1d..0a560cec77 100644
    a b form#tags-filter { 
    658658        min-height: 1.6923em;
    659659}
    660660
    661 /* Suggested text for privacy policy */
    662 .wp-privacy-policy-guide {
    663         max-width: 1000px;
    664 }
    665 
    666 .privacy-text-box {
    667         width: calc(100% - 260px);
    668 }
    669 
    670 .privacy-text-box-toc {
    671         float: right;
    672         width: 250px;
    673         background-color: #fff;
    674 }
    675 
    676 .privacy-text-box-toc p {
    677         margin: 0;
    678         padding: 0.7em 1em;
    679         border-bottom: 1px solid #eee;
    680 }
    681 
    682 .privacy-text-box-toc ol {
    683         margin-left: 2em;
    684 }
    685 
    686 .wp-privacy-policy-guide h3 {
    687         font-size: 1.2em;
    688         margin: 1em 0 0.5em;
    689 }
    690 
    691 .privacy-text-section .privacy-text-copy {
    692         float: right;
    693 }
    694 
    695 .privacy-text-section {
    696         position: relative;
    697         border-top: 1px solid #e3e3e3;
    698 }
    699 
    700 .privacy-text-box-head,
    701 .privacy-text-section.text-removed {
    702         padding-bottom: 12px;
    703 }
    704 
    705 .text-removed .policy-text {
    706         font-style: italic;
    707         color: #666;
    708         font-weight: 600;
    709 }
    710 
    711 .privacy-text-actions {
    712         height: 32px;
    713         line-height: 2.46153846;
    714         padding-bottom: 6px;
    715 }
    716 
    717 .wp-privacy-policy-guide .policy-text h2 {
    718         margin: 1.2em 0 1em;
    719         padding: 0;
    720 }
    721 
    722 .suggested-policy-content {
    723         font-style: italic;
    724 }
    725 
    726 .privacy-text-section a.return-to-top {
    727         float: right;
    728         margin-right: -250px;
    729         margin-top: 6px;
    730 }
    731 
    732 .hide-privacy-policy-tutorial .wp-policy-help, /* For back-compat, see #49282 */
    733 .hide-privacy-policy-tutorial .privacy-policy-tutorial {
    734         visibility: hidden;
    735 }
    736 
    737 .wp-suggested-text p {
    738         font-style: italic;
    739 }
    740 
    741 .wp-suggested-text p.wp-policy-help, /* For back-compat, see #49282 */
    742 .wp-suggested-text p.privacy-policy-tutorial {
    743         font-style: normal;
    744 }
    745 
    746 .notice.wp-pp-notice {
    747         margin: 15px 0 3px;
    748 }
    749 
    750661/*------------------------------------------------------------------------------
    751662  11.1 - Custom Fields
    752663------------------------------------------------------------------------------*/
  • src/wp-admin/includes/class-wp-privacy-policy-content.php

    diff --git a/src/wp-admin/includes/class-wp-privacy-policy-content.php b/src/wp-admin/includes/class-wp-privacy-policy-content.php
    index 65f27470a3..3338057d22 100644
    a b final class WP_Privacy_Policy_Content { 
    142142                                printf(
    143143                                        /* translators: %s: Privacy Policy Guide URL. */
    144144                                        __( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
    145                                         esc_url( admin_url( 'privacy-policy-guide.php' ) )
     145                                        esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) )
    146146                                );
    147147                        ?>
    148148                        </p>
    final class WP_Privacy_Policy_Content { 
    325325                }
    326326
    327327                $message = __( 'Need help putting together your new Privacy Policy page? Check out our guide for recommendations on what content to include, along with policies suggested by your plugins and theme.' );
    328                 $url     = esc_url( admin_url( 'privacy-policy-guide.php' ) );
     328                $url     = esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) );
    329329                $label   = __( 'View Privacy Policy Guide.' );
    330330
    331331                if ( get_current_screen()->is_block_editor() ) {
    final class WP_Privacy_Policy_Content { 
    373373                $content_array = self::get_suggested_policy_text();
    374374
    375375                $content       = '';
    376                 $toc           = array( '<li><a href="#wp-privacy-policy-guide-introduction">' . __( 'Introduction' ) . '</a></li>' );
    377376                $date_format   = __( 'F j, Y' );
    378                 $copy          = __( 'Copy this section to clipboard' );
    379                 $return_to_top = '<a href="#" class="return-to-top">' . __( '&uarr; Return to Top' ) . '</a>';
    380377
    381378                foreach ( $content_array as $section ) {
    382379                        $class   = '';
    final class WP_Privacy_Policy_Content { 
    384381                        $removed = '';
    385382
    386383                        if ( ! empty( $section['removed'] ) ) {
    387                                 $class = ' text-removed';
     384                                $badge_class = ' red';
     385
    388386                                $date  = date_i18n( $date_format, $section['removed'] );
     387
    389388                                /* translators: %s: Date of plugin deactivation. */
    390                                 $meta = sprintf( __( 'Removed %s.' ), $date );
     389                                $badge_title = sprintf( __( 'Removed %s.' ), $date );
    391390
    392391                                /* translators: %s: Date of plugin deactivation. */
    393392                                $removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
    394393                                $removed = '<div class="error inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
    395394                        } elseif ( ! empty( $section['updated'] ) ) {
    396                                 $class = ' text-updated';
     395                                $badge_class = ' blue';
     396
    397397                                $date  = date_i18n( $date_format, $section['updated'] );
    398                                 /* translators: %s: Date of privacy policy text update. */
    399                                 $meta = sprintf( __( 'Updated %s.' ), $date );
    400                         }
    401398
    402                         if ( $meta ) {
    403                                 $meta = '<br><span class="privacy-text-meta">' . $meta . '</span>';
     399                                /* translators: %s: Date of privacy policy text update. */
     400                                $badge_title = sprintf( __( 'Updated %s.' ), $date );
    404401                        }
    405402
    406403                        $plugin_name = esc_html( $section['plugin_name'] );
    407                         $toc_id      = 'wp-privacy-policy-guide-' . sanitize_title( $plugin_name );
    408                         $toc[]       = sprintf( '<li><a href="#%1$s">%2$s</a>' . $meta . '</li>', $toc_id, $plugin_name );
    409 
    410                         $content .= '<div class="privacy-text-section' . $class . '">';
    411                         $content .= '<a id="' . $toc_id . '">&nbsp;</a>';
    412                         /* translators: %s: Plugin name. */
    413                         $content .= '<h2>' . sprintf( __( 'Source: %s' ), $plugin_name ) . '</h2>';
    414                         $content .= $removed;
    415 
    416                         $content .= '<div class="policy-text">' . $section['policy_text'] . '</div>';
    417                         $content .= $return_to_top;
    418 
    419                         if ( empty( $section['removed'] ) ) {
    420                                 $content         .= '<div class="privacy-text-actions">';
    421                                         $content     .= '<button type="button" class="privacy-text-copy button">';
    422                                                 $content .= $copy;
    423                                                 $content .= '<span class="screen-reader-text">';
    424                                                 /* translators: %s: Plugin name. */
    425                                                 $content .= sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name );
    426                                                 $content .= '</span>';
    427                                         $content     .= '</button>';
    428                                 $content         .= '</div>';
    429                         }
    430 
    431                         $content .= "</div>\n"; // End of .privacy-text-section.
    432                 }
    433404
    434                 if ( count( $toc ) > 2 ) {
     405                        $sanitized_policy_name = sanitize_title_with_dashes( $plugin_name );
    435406                        ?>
    436                         <div  class="privacy-text-box-toc">
    437                                 <p><?php _e( 'Table of Contents' ); ?></p>
    438                                 <ol>
    439                                         <?php echo implode( "\n", $toc ); ?>
    440                                 </ol>
     407                        <h4 class="privacy-settings-accordion-heading">
     408                        <button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" type="button">
     409                                <span class="title"><?php echo $plugin_name ?></span>
     410                                <?php if ( ! empty( $section['removed'] ) || ! empty( $section['updated'] ) ) : ?>
     411                                <span class="badge <?php echo $badge_class; ?>"> <?php echo $badge_title ?></span>
     412                                <?php endif; ?>
     413                                <span class="icon"></span>
     414                        </button>
     415                        </h4>
     416                        <div id="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" class="privacy-settings-accordion-panel privacy-text-box-body" hidden="hidden">
     417                                <?php
     418                                echo $removed;
     419                                echo $section['policy_text'];
     420                                ?>
     421                                <?php if ( empty( $section['removed'] ) ) : ?>
     422                                <div class="privacy-settings-accordion-actions">
     423                                        <button type="button" class="privacy-text-copy button">
     424                                                <?php _e( 'Copy this section to clipboard' ); ?>
     425                                                <span class="screen-reader-text">
     426                                                        <?php
     427                                                        /* translators: %s: Plugin name. */
     428                                                        sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name );
     429                                                        ?>
     430                                                </span>
     431                                        </button>
     432                                </div>
     433                                <?php endif; ?>
    441434                        </div>
    442435                        <?php
    443436                }
    444 
    445                 ?>
    446                 <div class="privacy-text-box">
    447                         <div class="privacy-text-box-head">
    448                                 <a id="wp-privacy-policy-guide-introduction">&nbsp;</a>
    449                                 <h2><?php _e( 'Introduction' ); ?></h2>
    450                                 <p><?php _e( 'Hello,' ); ?></p>
    451                                 <p><?php _e( 'This text template will help you to create your web site&#8217;s privacy policy.' ); ?></p>
    452                                 <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>
    453                                 <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>
    454                                 <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>
    455                         </div>
    456 
    457                         <div class="privacy-text-box-body">
    458                                 <?php echo $content; ?>
    459                         </div>
    460                 </div>
    461                 <?php
    462437        }
    463438
    464439        /**
    final class WP_Privacy_Policy_Content { 
    472447         * @return string The default policy content.
    473448         */
    474449        public static function get_default_content( $description = false, $blocks = true ) {
    475                 $suggested_text = $description ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : '';
     450                $suggested_text = '<p class="privacy-policy-suggested-text-header">' . __( 'Suggested text:' ) . ' </p>';
    476451                $content        = '';
    477452                $strings        = array();
    478453
    479454                // Start of the suggested privacy policy text.
    480                 if ( $description ) {
    481                         $strings[] = '<div class="wp-suggested-text">';
    482                 }
    483455
    484456                /* translators: Default privacy policy heading. */
    485457                $strings[] = '<h2>' . __( 'Who we are' ) . '</h2>';
    final class WP_Privacy_Policy_Content { 
    489461                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '</p>';
    490462                        /* translators: Privacy policy tutorial. */
    491463                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '</p>';
     464                } else {
     465                        $strings[] = $suggested_text;
     466                        /* translators: Default privacy policy text. %s: Site URL. */
     467                        $strings[] = '<p class="privacy-policy-suggested-text">' . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';
    492468                }
    493469
    494                 /* translators: Default privacy policy text. %s: Site URL. */
    495                 $strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';
    496 
    497                 /* translators: Default privacy policy heading. */
    498                 $strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
    499 
    500470                if ( $description ) {
     471                        /* translators: Default privacy policy heading. */
     472                        $strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
     473
    501474                        /* translators: Privacy policy tutorial. */
    502475                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include personal data, such as name, email address, personal account preferences; transactional data, such as purchase information; and technical data, such as information about cookies.' ) . '</p>';
    503476                        /* translators: Privacy policy tutorial. */
    final class WP_Privacy_Policy_Content { 
    516489                if ( $description ) {
    517490                        /* translators: Privacy policy tutorial. */
    518491                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information is captured through comments. We have noted the data which WordPress collects by default.' ) . '</p>';
     492                } else {
     493                        $strings[] = $suggested_text;
     494                        /* translators: Default privacy policy text. */
     495                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>';
     496                        /* translators: Default privacy policy text. */
     497                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '</p>';
    519498                }
    520499
    521                 /* translators: Default privacy policy text. */
    522                 $strings[] = '<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>';
    523                 /* translators: Default privacy policy text. */
    524                 $strings[] = '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '</p>';
    525 
    526500                /* translators: Default privacy policy heading. */
    527501                $strings[] = '<h3>' . __( 'Media' ) . '</h3>';
    528502
    529503                if ( $description ) {
    530504                        /* translators: Privacy policy tutorial. */
    531505                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '</p>';
     506                } else {
     507                        $strings[] = $suggested_text;
     508                        /* translators: Default privacy policy text. */
     509                        $strings[] = '<p class="privacy-policy-suggested-text">'  . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>';
    532510                }
    533511
    534                 /* translators: Default privacy policy text. */
    535                 $strings[] = '<p>' . $suggested_text . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>';
    536 
    537                 /* translators: Default privacy policy heading. */
    538                 $strings[] = '<h3>' . __( 'Contact forms' ) . '</h3>';
    539 
    540512                if ( $description ) {
     513                        /* translators: Default privacy policy heading. */
     514                        $strings[] = '<h3>' . __( 'Contact forms' ) . '</h3>';
     515
    541516                        /* translators: Privacy policy tutorial. */
    542517                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '</p>';
    543518                }
    final class WP_Privacy_Policy_Content { 
    548523                if ( $description ) {
    549524                        /* translators: Privacy policy tutorial. */
    550525                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list the cookies your web site uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '</p>';
     526                } else {
     527                        $strings[] = $suggested_text;
     528                        /* translators: Default privacy policy text. */
     529                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>';
     530                        /* translators: Default privacy policy text. */
     531                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '</p>';
     532                        /* translators: Default privacy policy text. */
     533                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select &quot;Remember Me&quot;, your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>';
     534                        /* translators: Default privacy policy text. */
     535                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.' ) . '</p>';
    551536                }
    552537
    553                 /* translators: Default privacy policy text. */
    554                 $strings[] = '<p>' . $suggested_text . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>';
    555                 /* translators: Default privacy policy text. */
    556                 $strings[] = '<p>' . __( 'If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '</p>';
    557                 /* translators: Default privacy policy text. */
    558                 $strings[] = '<p>' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select &quot;Remember Me&quot;, your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>';
    559                 /* translators: Default privacy policy text. */
    560                 $strings[] = '<p>' . __( 'If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.' ) . '</p>';
    561 
    562                 /* translators: Default privacy policy heading. */
    563                 $strings[] = '<h3>' . __( 'Embedded content from other websites' ) . '</h3>';
    564                 /* translators: Default privacy policy text. */
    565                 $strings[] = '<p>' . $suggested_text . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '</p>';
    566                 /* translators: Default privacy policy text. */
    567                 $strings[] = '<p>' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>';
     538                if ( ! $description ) {
     539                        /* translators: Default privacy policy heading. */
     540                        $strings[] = '<h3>' . __( 'Embedded content from other websites' ) . '</h3>';
    568541
    569                 /* translators: Default privacy policy heading. */
    570                 $strings[] = '<h3>' . __( 'Analytics' ) . '</h3>';
     542                        $strings[] = $suggested_text;
     543                        /* translators: Default privacy policy text. */
     544                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '</p>';
     545                        /* translators: Default privacy policy text. */
     546                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>';
     547                }
    571548
    572549                if ( $description ) {
     550                        /* translators: Default privacy policy heading. */
     551                        $strings[] = '<h3>' . __( 'Analytics' ) . '</h3>';
     552
    573553                        /* translators: Privacy policy tutorial. */
    574554                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to your analytics provider&#8217;s privacy policy, if any.' ) . '</p>';
    575555                        /* translators: Privacy policy tutorial. */
    576556                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';
    577557                }
    578558
    579                 /* translators: Default privacy policy heading. */
    580                 $strings[] = '<h2>' . __( 'Who we share your data with' ) . '</h2>';
    581 
    582559                if ( $description ) {
     560                        /* translators: Default privacy policy heading. */
     561                        $strings[] = '<h2>' . __( 'Who we share your data with' ) . '</h2>';
     562
    583563                        /* translators: Privacy policy tutorial. */
    584564                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy policies if possible.' ) . '</p>';
    585565                        /* translators: Privacy policy tutorial. */
    final class WP_Privacy_Policy_Content { 
    592572                if ( $description ) {
    593573                        /* translators: Privacy policy tutorial. */
    594574                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>';
     575                } else {
     576                        $strings[] = $suggested_text;
     577                        /* translators: Default privacy policy text. */
     578                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>';
     579                        /* translators: Default privacy policy text. */
     580                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>';
    595581                }
    596582
    597                 /* translators: Default privacy policy text. */
    598                 $strings[] = '<p>' . $suggested_text . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>';
    599                 /* translators: Default privacy policy text. */
    600                 $strings[] = '<p>' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>';
    601 
    602583                /* translators: Default privacy policy heading. */
    603584                $strings[] = '<h2>' . __( 'What rights you have over your data' ) . '</h2>';
    604585
    605586                if ( $description ) {
    606587                        /* translators: Privacy policy tutorial. */
    607588                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>';
     589                } else {
     590                        $strings[] = $suggested_text;
     591                        /* translators: Default privacy policy text. */
     592                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>';
    608593                }
    609594
    610                 /* translators: Default privacy policy text. */
    611                 $strings[] = '<p>' . $suggested_text . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>';
    612 
    613595                /* translators: Default privacy policy heading. */
    614596                $strings[] = '<h2>' . __( 'Where we send your data' ) . '</h2>';
    615597
    final class WP_Privacy_Policy_Content { 
    618600                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>';
    619601                        /* translators: Privacy policy tutorial. */
    620602                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>';
     603                } else {
     604                        $strings[] = $suggested_text;
     605                        /* translators: Default privacy policy text. */
     606                        $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
    621607                }
    622608
    623                 /* translators: Default privacy policy text. */
    624                 $strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
    625 
    626                 /* translators: Default privacy policy heading. */
    627                 $strings[] = '<h2>' . __( 'Your contact information' ) . '</h2>';
    628 
    629609                if ( $description ) {
     610                        /* translators: Default privacy policy heading. */
     611                        $strings[] = '<h2>' . __( 'Your contact information' ) . '</h2>';
     612
    630613                        /* translators: Privacy policy tutorial. */
    631614                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '</p>';
    632615                }
    633616
    634                 /* translators: Default privacy policy heading. */
    635                 $strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';
    636 
    637617                if ( $description ) {
     618                        /* translators: Default privacy policy heading. */
     619                        $strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';
     620
    638621                        /* translators: Privacy policy tutorial. */
    639622                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '</p>';
    640623                }
    641624
    642                 /* translators: Default privacy policy heading. */
    643                 $strings[] = '<h3>' . __( 'How we protect your data' ) . '</h3>';
    644 
    645625                if ( $description ) {
     626                        /* translators: Default privacy policy heading. */
     627                        $strings[] = '<h3>' . __( 'How we protect your data' ) . '</h3>';
     628
    646629                        /* translators: Privacy policy tutorial. */
    647630                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users&#8217; data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>';
    648631                }
    649632
    650                 /* translators: Default privacy policy heading. */
    651                 $strings[] = '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
    652 
    653633                if ( $description ) {
     634                        /* translators: Default privacy policy heading. */
     635                        $strings[] = '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
     636
    654637                        /* translators: Privacy policy tutorial. */
    655638                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>';
    656639                }
    657640
    658                 /* translators: Default privacy policy heading. */
    659                 $strings[] = '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
    660 
    661641                if ( $description ) {
     642                        /* translators: Default privacy policy heading. */
     643                        $strings[] = '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
     644
    662645                        /* translators: Privacy policy tutorial. */
    663646                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '</p>';
    664647                }
    665648
    666                 /* translators: Default privacy policy heading. */
    667                 $strings[] = '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
    668649
    669650                if ( $description ) {
     651                        /* translators: Default privacy policy heading. */
     652                        $strings[] = '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
     653
    670654                        /* translators: Privacy policy tutorial. */
    671655                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>';
    672656                }
    673657
    674                 /* translators: Default privacy policy heading. */
    675                 $strings[] = '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
    676 
    677658                if ( $description ) {
     659                        /* translators: Default privacy policy heading. */
     660                        $strings[] = '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
     661
    678662                        /* translators: Privacy policy tutorial. */
    679663                        $strings[] = '<p class="privacy-policy-tutorial">' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>';
    680                         $strings[] = '</div>';
    681664                }
    682665
    683666                if ( $blocks ) {
    final class WP_Privacy_Policy_Content { 
    705688                 * @since 4.9.6
    706689                 * @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters.
    707690                 *
     691                 * @deprecated 5.4.0 This filter has been deprecated.
     692                 *
    708693                 * @param string   $content     The default policy content.
    709694                 * @param string[] $strings     An array of privacy policy content strings.
    710695                 * @param bool     $description Whether policy descriptions should be included.
    711696                 * @param bool     $blocks      Whether the content should be formatted for the block editor.
    712697                 */
    713                 return apply_filters( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks );
     698                return apply_filters_deprecated( 'wp_get_default_privacy_policy_content', array( $content, $strings, $description, $blocks ), '5.4.0', false );
    714699        }
    715700
    716701        /**
    final class WP_Privacy_Policy_Content { 
    719704         * @since 4.9.6
    720705         */
    721706        public static function add_suggested_content() {
    722                 $content = self::get_default_content( true, false );
     707                $content = self::get_default_content( false, false );
    723708                wp_add_privacy_policy_content( __( 'WordPress' ), $content );
    724709        }
    725710}
  • src/wp-admin/options-privacy.php

    diff --git a/src/wp-admin/options-privacy.php b/src/wp-admin/options-privacy.php
    index 95492b326f..80c310612b 100644
    a b if ( ! current_user_can( 'manage_privacy_options' ) ) { 
    1313        wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) );
    1414}
    1515
     16if ( isset( $_GET['tab'] ) && 'policyguide' === $_GET['tab'] ) {
     17        require_once( dirname( __FILE__ ) . '/privacy-policy-guide.php' );
     18        return;
     19}
     20
     21add_filter(
     22        'admin_body_class',
     23        function( $body_class ) {
     24                $body_class .= ' privacy-settings ';
     25
     26                return $body_class;
     27        }
     28);
     29
    1630$action = isset( $_POST['action'] ) ? $_POST['action'] : '';
    1731
    1832if ( ! empty( $action ) ) {
    if ( ! empty( $privacy_policy_page_id ) ) { 
    112126        }
    113127}
    114128
    115 $title       = __( 'Privacy Settings' );
    116129$parent_file = 'options-general.php';
    117130
     131wp_enqueue_script( 'privacy-tools' );
     132
    118133require_once( ABSPATH . 'wp-admin/admin-header.php' );
    119134
    120135?>
    121 <div class="wrap">
    122         <h1><?php echo $title; ?></h1>
    123         <h2><?php _e( 'Privacy Policy Page' ); ?></h2>
     136<div class="privacy-settings-header">
     137        <div class="privacy-settings-title-section">
     138                <h1>
     139                        <?php _e( 'Privacy' ); ?>
     140                </h1>
     141        </div>
     142
     143        <nav class="privacy-settings-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
     144                <a href="<?php echo esc_url( admin_url( 'options-privacy.php' ) ); ?>" class="privacy-settings-tab active" aria-current="true">
     145                        <?php
     146                        /* translators: Tab heading for Site Health Status page. */
     147                        _ex( 'Settings', 'Privacy Settings' );
     148                        ?>
     149                </a>
     150
     151                <a href="<?php echo esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); ?>" class="privacy-settings-tab">
     152                        <?php
     153                        /* translators: Tab heading for Site Health Status page. */
     154                        _ex( 'Policy Guide', 'Privacy Settings' );
     155                        ?>
     156                </a>
     157        </nav>
     158</div>
     159
     160<hr class="wp-header-end">
     161
     162<div class="notice notice-error hide-if-js">
     163        <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p>
     164</div>
     165
     166<div class="privacy-settings-body hide-if-no-js">
     167        <h2><?php _e( 'Privacy Settings' ); ?></h2>
    124168        <p>
    125169                <?php _e( 'As a website owner, you may need to follow national or international privacy laws. For example, you may need to create and display a Privacy Policy.' ); ?>
    126170                <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?>
    require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    133177                <?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?>
    134178                <?php _e( 'We would also suggest reviewing your Privacy Policy from time to time, especially after installing or updating any themes or plugins. There may be changes or new suggested information for you to consider adding to your policy.' ); ?>
    135179        </p>
    136         <?php
    137 
    138         if ( $privacy_policy_page_exists ) {
    139                 $edit_href = add_query_arg(
    140                         array(
    141                                 'post'   => $privacy_policy_page_id,
    142                                 'action' => 'edit',
    143                         ),
    144                         admin_url( 'post.php' )
    145                 );
    146 
    147                 $view_href = get_permalink( $privacy_policy_page_id );
    148                 ?>
    149                 <p class="tools-privacy-edit"><strong>
    150                         <?php
    151                         if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {
    152                                 printf(
    153                                         /* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page. */
    154                                         __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ),
    155                                         esc_url( $edit_href ),
    156                                         esc_url( $view_href )
    157                                 );
    158                         } else {
    159                                 printf(
    160                                         /* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page. */
    161                                         __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ),
    162                                         esc_url( $edit_href ),
    163                                         esc_url( $view_href )
    164                                 );
    165                         }
    166                         ?>
    167                 </strong></p>
    168                 <?php
    169         }
    170         ?>
    171180        <p>
    172181                <?php
     182                if ( $privacy_policy_page_exists ) {
     183                        $edit_href = add_query_arg(
     184                                array(
     185                                        'post'   => $privacy_policy_page_id,
     186                                        'action' => 'edit',
     187                                ),
     188                                admin_url( 'post.php' )
     189                        );
     190
     191                        $view_href = get_permalink( $privacy_policy_page_id );
     192                        ?>
     193                                <strong>
     194                                <?php
     195                                if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {
     196                                        printf(
     197                                                /* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page. */
     198                                                __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ),
     199                                                esc_url( $edit_href ),
     200                                                esc_url( $view_href )
     201                                        );
     202                                } else {
     203                                        printf(
     204                                                /* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page. */
     205                                                __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ),
     206                                                esc_url( $edit_href ),
     207                                                esc_url( $view_href )
     208                                        );
     209                                }
     210                                ?>
     211                                </strong>
     212                        <?php
     213                }
    173214                printf(
    174215                        /* translators: 1: Privacy Policy guide URL, 2: Additional link attributes, 3: Accessibility text. */
    175                         __( 'Need help putting together your new Privacy Policy page? <a href="%1$s" %2$s>Check out our guide%3$s</a> for recommendations on what content to include, along with policies suggested by your plugins and theme.' ),
    176                         esc_url( admin_url( 'privacy-policy-guide.php' ) ),
     216                        __( 'Need help putting together your new Privacy Policy page? <a href="%1$s" %2$s>Check out our Privacy Policy guide%3$s</a> for recommendations on what content to include, along with policies suggested by your plugins and theme.' ),
     217                        esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ),
    177218                        '',
    178219                        ''
    179220                );
    require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    181222        </p>
    182223
    183224        <hr>
     225
     226        <?php
     227        $has_pages = (bool) get_posts(
     228                array(
     229                        'post_type'      => 'page',
     230                        'posts_per_page' => 1,
     231                        'post_status'    => array(
     232                                'publish',
     233                                'draft',
     234                        ),
     235                )
     236        );
     237        ?>
     238
    184239        <table class="form-table tools-privacy-policy-page" role="presentation">
     240                <tr>
     241                        <th scope="row">
     242                                <label for="create-page">
     243                                <?php
     244                                if ( $has_pages ) {
     245                                        _e( 'Create a new Privacy Policy Page' );
     246                                } else {
     247                                        _e( 'There are no pages.' );
     248                                }
     249                                ?>
     250                                </label>
     251                        </td>
     252                        <td>
     253                                <form class="wp-create-privacy-page" method="post" action="">
     254                                        <input type="hidden" name="action" value="create-privacy-page" />
     255                                        <?php
     256                                        wp_nonce_field( 'create-privacy-page' );
     257
     258                                        submit_button( __( 'Create' ), 'secondary', 'submit', false, array( 'id' => 'create-page' ) );
     259                                        ?>
     260                                </form>
     261                        </td>
     262                </tr>
     263                <?php if ( $has_pages ) : ?>
    185264                <tr>
    186265                        <th scope="row">
    187266                                <label for="page_for_privacy_policy">
    require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    195274                                </label>
    196275                        </th>
    197276                        <td>
    198                                 <?php
    199                                 $has_pages = (bool) get_posts(
    200                                         array(
    201                                                 'post_type'      => 'page',
    202                                                 'posts_per_page' => 1,
    203                                                 'post_status'    => array(
    204                                                         'publish',
    205                                                         'draft',
    206                                                 ),
    207                                         )
    208                                 );
    209 
    210                                 if ( $has_pages ) :
    211                                         ?>
    212                                         <form method="post" action="">
    213                                                 <input type="hidden" name="action" value="set-privacy-page" />
    214                                                 <?php
    215                                                 wp_dropdown_pages(
    216                                                         array(
    217                                                                 'name'              => 'page_for_privacy_policy',
    218                                                                 'show_option_none'  => __( '&mdash; Select &mdash;' ),
    219                                                                 'option_none_value' => '0',
    220                                                                 'selected'          => $privacy_policy_page_id,
    221                                                                 'post_status'       => array( 'draft', 'publish' ),
    222                                                         )
    223                                                 );
    224 
    225                                                 wp_nonce_field( 'set-privacy-page' );
    226 
    227                                                 submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );
    228                                                 ?>
    229                                         </form>
    230                                 <?php endif; ?>
    231 
    232                                 <form class="wp-create-privacy-page" method="post" action="">
    233                                         <input type="hidden" name="action" value="create-privacy-page" />
    234                                         <span>
    235                                                 <?php
    236                                                 if ( $has_pages ) {
    237                                                         _e( 'Or:' );
    238                                                 } else {
    239                                                         _e( 'There are no pages.' );
    240                                                 }
    241                                                 ?>
    242                                         </span>
     277                                <form method="post" action="">
     278                                        <input type="hidden" name="action" value="set-privacy-page" />
    243279                                        <?php
    244                                         wp_nonce_field( 'create-privacy-page' );
     280                                        wp_dropdown_pages(
     281                                                array(
     282                                                        'name'              => 'page_for_privacy_policy',
     283                                                        'show_option_none'  => __( '&mdash; Select &mdash;' ),
     284                                                        'option_none_value' => '0',
     285                                                        'selected'          => $privacy_policy_page_id,
     286                                                        'post_status'       => array( 'draft', 'publish' ),
     287                                                )
     288                                        );
    245289
    246                                         submit_button( __( 'Create New Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) );
     290                                        wp_nonce_field( 'set-privacy-page' );
     291
     292                                        submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );
    247293                                        ?>
    248294                                </form>
    249295                        </td>
    250296                </tr>
     297                <?php endif; ?>
    251298        </table>
     299
    252300</div>
    253301<?php
    254302
  • src/wp-admin/privacy-policy-guide.php

    diff --git a/src/wp-admin/privacy-policy-guide.php b/src/wp-admin/privacy-policy-guide.php
    index f3d8703f88..0bddf3ac44 100644
    a b if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { 
    1717        include_once( ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php' );
    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' );
    2330
    2431require_once( ABSPATH . 'wp-admin/admin-header.php' );
    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>
     40
     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>
    2963
    30         <div class="wp-privacy-policy-guide">
     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
     72        <div class="privacy-settings-accordion">
     73                <h4 class="privacy-settings-accordion-heading">
     74                        <button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-privacy-policy-guide" type="button">
     75                                <span class="title"><?php _e( 'Privacy Policy Guide' ); ?></span>
     76                                <span class="icon"></span>
     77                        </button>
     78                </h4>
     79                <div id="privacy-settings-accordion-block-privacy-policy-guide" class="privacy-settings-accordion-panel" hidden="hidden">
     80                        <?php
     81                        $content = WP_Privacy_Policy_Content::get_default_content( true, false );
     82                        echo $content;
     83                        ?>
     84                </div>
     85        </div>
     86
     87        <hr class="hr-separator">
     88
     89        <h3 class="section-title"><?php _e( 'Policies' ); ?></h3>
     90
     91        <div class="privacy-settings-accordion wp-privacy-policy-guide">
    3192                <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>
    3293        </div>
    33 </div>
     94</div> <!-- privacy-settings-body -->
     95
    3496<?php
    3597
    3698include( ABSPATH . 'wp-admin/admin-footer.php' );
  • src/wp-admin/tools.php

    diff --git a/src/wp-admin/tools.php b/src/wp-admin/tools.php
    index 447d6738ac..e7f87591da 100644
    a b require_once( dirname( __FILE__ ) . '/admin.php' ); 
    2323
    2424// The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php.
    2525if ( isset( $_GET['wp-privacy-policy-guide'] ) ) {
    26         wp_redirect( admin_url( 'privacy-policy-guide.php' ), 301 );
     26        wp_redirect( admin_url( 'options-privacy.php?tab=policyguide' ), 301 );
    2727        exit;
    2828} elseif ( isset( $_GET['page'] ) ) {
    2929        // These were also moved to files in WP 5.3.