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.

Built from https://develop.svn.wordpress.org/trunk@50161


git-svn-id: http://core.svn.wordpress.org/trunk@49840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
TimothyBlynJacobs 2021-02-02 20:14:03 +00:00
parent f1483599a2
commit 9bab39685a
11 changed files with 783 additions and 455 deletions

View File

@ -696,158 +696,283 @@ form#tags-filter {
min-height: 1.6923em;
}
/* Suggested text for privacy policy */
.wp-privacy-policy-guide {
max-width: 1000px;
/**
* Privacy Settings section
*/
/* General */
.privacy-settings #wpcontent,
.privacy-settings.auto-fold #wpcontent {
padding-right: 0;
}
.privacy-text-box {
width: calc(100% - 260px);
.privacy-settings-header h1 {
display: inline-block;
font-weight: 600;
margin: 0 0.8rem 1rem;
font-size: 23px;
padding: 9px 0 4px 0;
line-height: 1.3;
}
.privacy-text-box-toc {
float: left;
width: 250px;
background-color: #fff;
/* Header */
.privacy-settings-header {
text-align: center;
margin: 0 0 1rem;
background: #fff;
border-bottom: 1px solid #e2e4e7;
}
.privacy-text-box-toc p {
.privacy-settings-title-section {
display: flex;
align-items: center;
justify-content: center;
clear: both;
}
.privacy-settings-tabs-wrapper {
/* IE 11 */
display: -ms-inline-grid;
-ms-grid-columns: 1fr 1fr;
vertical-align: top;
/* modern browsers */
display: inline-grid;
grid-template-columns: 1fr 1fr;
}
.privacy-settings-tab {
display: block; /* IE 11 */
text-decoration: none;
color: inherit;
padding: 0.5rem 1rem 1rem;
margin: 0 1rem;
transition: box-shadow 0.5s ease-in-out;
}
.privacy-settings-tab:nth-child(1) {
-ms-grid-column: 1; /* IE 11 */
}
.privacy-settings-tab:nth-child(2) {
-ms-grid-column: 2; /* IE 11 */
}
.privacy-settings-tab:focus {
color: #191e23;
outline: 1px solid #6c7781;
box-shadow: none;
}
.privacy-settings-tab.active {
box-shadow: inset 0 -3px #007cba;
font-weight: 600;
}
/* Body */
.privacy-settings-body {
max-width: 800px;
margin: 0 auto;
}
.tools-privacy-policy-page th {
min-width: 230px;
}
.hr-separator {
margin-top: 20px;
margin-bottom: 15px;
}
/* Accordions */
.privacy-settings-accordion {
border: 1px solid #ccd0d4;
}
.privacy-settings-accordion-heading {
margin: 0;
padding: 0.7em 1em;
border-bottom: 1px solid #f0f0f1;
border-top: 1px solid #ccd0d4;
font-size: inherit;
line-height: inherit;
font-weight: 600;
color: inherit;
}
.privacy-text-box-toc ol {
margin-right: 2em;
.privacy-settings-accordion-heading:first-child {
border-top: none;
}
.wp-privacy-policy-guide h3 {
font-size: 1.2em;
margin: 1em 0 0.5em;
}
.privacy-text-section .privacy-text-copy {
float: left;
}
.privacy-text-section {
.privacy-settings-accordion-trigger {
background: #fff;
border: 0;
color: #32373c;
cursor: pointer;
display: flex;
font-weight: 400;
margin: 0;
padding: 1em 1.5em 1em 3.5em;
min-height: 46px;
position: relative;
border-top: 1px solid #dcdcde;
}
.privacy-text-box-head,
.privacy-text-section.text-removed {
padding-bottom: 12px;
}
.text-removed .policy-text {
color: #646970;
font-weight: 300;
padding-right: 1em;
border-right: 3px solid #dba617;
}
.text-removed .policy-text h1,
.text-removed .policy-text h2,
.text-removed .policy-text h3,
.text-removed .policy-text h4,
.text-removed .policy-text h5,
.text-removed .policy-text h6 {
color: #3c434a;
font-weight: 500;
}
.privacy-text-actions {
display: inline-block;
text-align: right;
width: 100%;
height: 32px;
line-height: 2.46153846;
padding-bottom: 6px;
align-items: center;
justify-content: space-between;
}
.privacy-text-actions .success {
display: none;
color: #008a20;
float: left;
padding-left: 1em;
.privacy-settings-accordion-trigger:hover,
.privacy-settings-accordion-trigger:active {
background: #f8f9f9;
}
.privacy-text-actions .success.visible {
display: inline-block;
height: 32px;
.privacy-settings-accordion-trigger:focus {
color: #191e23;
border: none;
box-shadow: none;
outline-offset: -1px;
outline: 2px solid #0071a1;
background-color: #f8f9f9;
}
.wp-privacy-policy-guide .policy-text h2 {
margin: 1.2em 0 1em;
padding: 0;
.privacy-settings-accordion-trigger .title {
pointer-events: none;
font-weight: 600;
flex-grow: 1;
}
.suggested-policy-content {
font-style: italic;
.privacy-settings-accordion-trigger .icon,
.privacy-settings-view-read .icon {
border: solid #555d66;
border-width: 0 0 2px 2px;
height: 0.5rem;
pointer-events: none;
position: absolute;
left: 1.5em;
top: 50%;
transform: translateY(-70%) rotate(-45deg);
width: 0.5rem;
}
.privacy-text-section .return-to-top {
float: left;
margin-left: -250px;
margin-top: 6px;
.privacy-settings-accordion-trigger .badge {
padding: 0.1rem 0.5rem 0.15rem;
color: #32373c;
font-weight: 600;
margin-right: 0.5rem;
}
#wpbody:target:before {
content: "";
display: block;
padding-top: 50px;
margin-top: -50px;
.privacy-settings-accordion-trigger .badge.blue {
border: 1px solid #bfe7f3;
}
.hide-privacy-policy-tutorial {
background-color: #fff;
.privacy-settings-accordion-trigger .badge.orange {
border: 1px solid #ffb900;
}
.hide-privacy-policy-tutorial .wp-policy-help, /* For back-compat, see #49282 */
.hide-privacy-policy-tutorial .privacy-policy-tutorial {
display: none;
.privacy-settings-accordion-trigger .badge.red {
border: 1px solid #dc3232;
}
.policy-text {
margin-bottom: 1em;
.privacy-settings-accordion-trigger .badge.green {
border: 1px solid #46b450;
}
.policy-text > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help),
.policy-text div > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help) {
background-color: #fff;
.privacy-settings-accordion-trigger .badge.purple {
border: 1px solid #826eb4;
}
.privacy-settings-accordion-trigger .badge.gray {
border: 1px solid #ccd0d4;
}
.privacy-settings-accordion-trigger[aria-expanded="true"] .icon,
.privacy-settings-view-passed[aria-expanded="true"] .icon {
transform: translateY(-30%) rotate(135deg)
}
.privacy-settings-accordion-panel {
margin: 0;
padding: 1em;
padding: 1em 1.5em;
background: #fff;
}
.policy-text > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help) + *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help),
.policy-text div > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help) + *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help) {
padding-top: 0;
.privacy-settings-accordion-panel[hidden] {
display: none;
}
.hide-privacy-policy-tutorial > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help) {
margin: 1em 0;
padding: 0;
.privacy-settings-accordion-panel a .dashicons {
text-decoration: none;
}
.policy-text ul li,
.policy-text ol li {
margin-right: 2em;
.privacy-settings-accordion-actions {
text-align: left;
display: block;
}
.policy-text ul {
list-style: disc;
.privacy-settings-accordion-actions .success {
display: none;
color: #40860a;
padding-left: 1em;
padding-top: 6px;
}
strong.wp-policy-help, /* For back-compat, see #49282 */
strong.privacy-policy-tutorial {
.privacy-settings-accordion-actions .success.visible {
display: inline-block;
}
/* Suggested text for privacy policy */
.privacy-settings-accordion-panel.hide-privacy-policy-tutorial .wp-policy-help, /* For back-compat, see #49282 */
.privacy-settings-accordion-panel.hide-privacy-policy-tutorial .privacy-policy-tutorial,
.privacy-settings-accordion-panel.hide-privacy-policy-tutorial .privacy-text-copy {
display: none;
}
.privacy-settings-accordion-panel strong.wp-policy-help, /* For back-compat, see #49282 */
.privacy-settings-accordion-panel strong.privacy-policy-tutorial {
display: block;
margin: 0 0 1em;
}
.notice.wp-pp-notice {
margin: 15px 0 3px;
.privacy-settings-accordion-panel .wp-suggested-text > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help):not(.privacy-text-copy):not(span.success),
.privacy-settings-accordion-panel .wp-suggested-text div > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help):not(.privacy-text-copy):not(span.success),
.privacy-settings-accordion-panel > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help):not(.privacy-text-copy):not(span.success),
.privacy-settings-accordion-panel div > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help):not(.privacy-text-copy):not(span.success) {
margin: 0;
padding: 1em;
border-right: 2px solid gray;
}
/* Media queries */
@media screen and (max-width: 782px) {
.privacy-settings-body {
margin: 0 12px;
width: auto;
}
.privacy-settings .notice {
margin: 5px 10px 15px;
}
.privacy-settings .update-nag {
margin-left: 10px;
margin-right: 10px;
}
input#create-page {
margin-top: 10px;
}
}
@media only screen and (max-width: 1004px) {
.privacy-settings-body {
margin: 0 22px;
width: auto;
}
}
/**
* End Privacy Settings section
*/
/*------------------------------------------------------------------------------
11.1 - Custom Fields
------------------------------------------------------------------------------*/

File diff suppressed because one or more lines are too long

View File

@ -695,158 +695,283 @@ form#tags-filter {
min-height: 1.6923em;
}
/* Suggested text for privacy policy */
.wp-privacy-policy-guide {
max-width: 1000px;
/**
* Privacy Settings section
*/
/* General */
.privacy-settings #wpcontent,
.privacy-settings.auto-fold #wpcontent {
padding-left: 0;
}
.privacy-text-box {
width: calc(100% - 260px);
.privacy-settings-header h1 {
display: inline-block;
font-weight: 600;
margin: 0 0.8rem 1rem;
font-size: 23px;
padding: 9px 0 4px 0;
line-height: 1.3;
}
.privacy-text-box-toc {
float: right;
width: 250px;
background-color: #fff;
/* Header */
.privacy-settings-header {
text-align: center;
margin: 0 0 1rem;
background: #fff;
border-bottom: 1px solid #e2e4e7;
}
.privacy-text-box-toc p {
.privacy-settings-title-section {
display: flex;
align-items: center;
justify-content: center;
clear: both;
}
.privacy-settings-tabs-wrapper {
/* IE 11 */
display: -ms-inline-grid;
-ms-grid-columns: 1fr 1fr;
vertical-align: top;
/* modern browsers */
display: inline-grid;
grid-template-columns: 1fr 1fr;
}
.privacy-settings-tab {
display: block; /* IE 11 */
text-decoration: none;
color: inherit;
padding: 0.5rem 1rem 1rem;
margin: 0 1rem;
transition: box-shadow 0.5s ease-in-out;
}
.privacy-settings-tab:nth-child(1) {
-ms-grid-column: 1; /* IE 11 */
}
.privacy-settings-tab:nth-child(2) {
-ms-grid-column: 2; /* IE 11 */
}
.privacy-settings-tab:focus {
color: #191e23;
outline: 1px solid #6c7781;
box-shadow: none;
}
.privacy-settings-tab.active {
box-shadow: inset 0 -3px #007cba;
font-weight: 600;
}
/* Body */
.privacy-settings-body {
max-width: 800px;
margin: 0 auto;
}
.tools-privacy-policy-page th {
min-width: 230px;
}
.hr-separator {
margin-top: 20px;
margin-bottom: 15px;
}
/* Accordions */
.privacy-settings-accordion {
border: 1px solid #ccd0d4;
}
.privacy-settings-accordion-heading {
margin: 0;
padding: 0.7em 1em;
border-bottom: 1px solid #f0f0f1;
border-top: 1px solid #ccd0d4;
font-size: inherit;
line-height: inherit;
font-weight: 600;
color: inherit;
}
.privacy-text-box-toc ol {
margin-left: 2em;
.privacy-settings-accordion-heading:first-child {
border-top: none;
}
.wp-privacy-policy-guide h3 {
font-size: 1.2em;
margin: 1em 0 0.5em;
}
.privacy-text-section .privacy-text-copy {
float: right;
}
.privacy-text-section {
.privacy-settings-accordion-trigger {
background: #fff;
border: 0;
color: #32373c;
cursor: pointer;
display: flex;
font-weight: 400;
margin: 0;
padding: 1em 3.5em 1em 1.5em;
min-height: 46px;
position: relative;
border-top: 1px solid #dcdcde;
}
.privacy-text-box-head,
.privacy-text-section.text-removed {
padding-bottom: 12px;
}
.text-removed .policy-text {
color: #646970;
font-weight: 300;
padding-left: 1em;
border-left: 3px solid #dba617;
}
.text-removed .policy-text h1,
.text-removed .policy-text h2,
.text-removed .policy-text h3,
.text-removed .policy-text h4,
.text-removed .policy-text h5,
.text-removed .policy-text h6 {
color: #3c434a;
font-weight: 500;
}
.privacy-text-actions {
display: inline-block;
text-align: left;
width: 100%;
height: 32px;
line-height: 2.46153846;
padding-bottom: 6px;
align-items: center;
justify-content: space-between;
}
.privacy-text-actions .success {
display: none;
color: #008a20;
float: right;
padding-right: 1em;
.privacy-settings-accordion-trigger:hover,
.privacy-settings-accordion-trigger:active {
background: #f8f9f9;
}
.privacy-text-actions .success.visible {
display: inline-block;
height: 32px;
.privacy-settings-accordion-trigger:focus {
color: #191e23;
border: none;
box-shadow: none;
outline-offset: -1px;
outline: 2px solid #0071a1;
background-color: #f8f9f9;
}
.wp-privacy-policy-guide .policy-text h2 {
margin: 1.2em 0 1em;
padding: 0;
.privacy-settings-accordion-trigger .title {
pointer-events: none;
font-weight: 600;
flex-grow: 1;
}
.suggested-policy-content {
font-style: italic;
.privacy-settings-accordion-trigger .icon,
.privacy-settings-view-read .icon {
border: solid #555d66;
border-width: 0 2px 2px 0;
height: 0.5rem;
pointer-events: none;
position: absolute;
right: 1.5em;
top: 50%;
transform: translateY(-70%) rotate(45deg);
width: 0.5rem;
}
.privacy-text-section .return-to-top {
float: right;
margin-right: -250px;
margin-top: 6px;
.privacy-settings-accordion-trigger .badge {
padding: 0.1rem 0.5rem 0.15rem;
color: #32373c;
font-weight: 600;
margin-left: 0.5rem;
}
#wpbody:target:before {
content: "";
display: block;
padding-top: 50px;
margin-top: -50px;
.privacy-settings-accordion-trigger .badge.blue {
border: 1px solid #bfe7f3;
}
.hide-privacy-policy-tutorial {
background-color: #fff;
.privacy-settings-accordion-trigger .badge.orange {
border: 1px solid #ffb900;
}
.hide-privacy-policy-tutorial .wp-policy-help, /* For back-compat, see #49282 */
.hide-privacy-policy-tutorial .privacy-policy-tutorial {
display: none;
.privacy-settings-accordion-trigger .badge.red {
border: 1px solid #dc3232;
}
.policy-text {
margin-bottom: 1em;
.privacy-settings-accordion-trigger .badge.green {
border: 1px solid #46b450;
}
.policy-text > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help),
.policy-text div > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help) {
background-color: #fff;
.privacy-settings-accordion-trigger .badge.purple {
border: 1px solid #826eb4;
}
.privacy-settings-accordion-trigger .badge.gray {
border: 1px solid #ccd0d4;
}
.privacy-settings-accordion-trigger[aria-expanded="true"] .icon,
.privacy-settings-view-passed[aria-expanded="true"] .icon {
transform: translateY(-30%) rotate(-135deg)
}
.privacy-settings-accordion-panel {
margin: 0;
padding: 1em;
padding: 1em 1.5em;
background: #fff;
}
.policy-text > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help) + *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help),
.policy-text div > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help) + *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help) {
padding-top: 0;
.privacy-settings-accordion-panel[hidden] {
display: none;
}
.hide-privacy-policy-tutorial > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help) {
margin: 1em 0;
padding: 0;
.privacy-settings-accordion-panel a .dashicons {
text-decoration: none;
}
.policy-text ul li,
.policy-text ol li {
margin-left: 2em;
.privacy-settings-accordion-actions {
text-align: right;
display: block;
}
.policy-text ul {
list-style: disc;
.privacy-settings-accordion-actions .success {
display: none;
color: #40860a;
padding-right: 1em;
padding-top: 6px;
}
strong.wp-policy-help, /* For back-compat, see #49282 */
strong.privacy-policy-tutorial {
.privacy-settings-accordion-actions .success.visible {
display: inline-block;
}
/* Suggested text for privacy policy */
.privacy-settings-accordion-panel.hide-privacy-policy-tutorial .wp-policy-help, /* For back-compat, see #49282 */
.privacy-settings-accordion-panel.hide-privacy-policy-tutorial .privacy-policy-tutorial,
.privacy-settings-accordion-panel.hide-privacy-policy-tutorial .privacy-text-copy {
display: none;
}
.privacy-settings-accordion-panel strong.wp-policy-help, /* For back-compat, see #49282 */
.privacy-settings-accordion-panel strong.privacy-policy-tutorial {
display: block;
margin: 0 0 1em;
}
.notice.wp-pp-notice {
margin: 15px 0 3px;
.privacy-settings-accordion-panel .wp-suggested-text > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help):not(.privacy-text-copy):not(span.success),
.privacy-settings-accordion-panel .wp-suggested-text div > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help):not(.privacy-text-copy):not(span.success),
.privacy-settings-accordion-panel > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help):not(.privacy-text-copy):not(span.success),
.privacy-settings-accordion-panel div > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help):not(.privacy-text-copy):not(span.success) {
margin: 0;
padding: 1em;
border-left: 2px solid gray;
}
/* Media queries */
@media screen and (max-width: 782px) {
.privacy-settings-body {
margin: 0 12px;
width: auto;
}
.privacy-settings .notice {
margin: 5px 10px 15px;
}
.privacy-settings .update-nag {
margin-right: 10px;
margin-left: 10px;
}
input#create-page {
margin-top: 10px;
}
}
@media only screen and (max-width: 1004px) {
.privacy-settings-body {
margin: 0 22px;
width: auto;
}
}
/**
* End Privacy Settings section
*/
/*------------------------------------------------------------------------------
11.1 - Custom Fields
------------------------------------------------------------------------------*/

File diff suppressed because one or more lines are too long

View File

@ -142,7 +142,7 @@ final class WP_Privacy_Policy_Content {
printf(
/* translators: %s: Privacy Policy Guide URL. */
__( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
esc_url( admin_url( 'privacy-policy-guide.php' ) )
esc_url( admin_url( 'privacy-policy-guide.php?tab=policyguide' ) )
);
?>
</p>
@ -328,7 +328,7 @@ final class WP_Privacy_Policy_Content {
}
$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.' );
$url = esc_url( admin_url( 'privacy-policy-guide.php' ) );
$url = esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) );
$label = __( 'View Privacy Policy Guide.' );
if ( get_current_screen()->is_block_editor() ) {
@ -375,7 +375,6 @@ final class WP_Privacy_Policy_Content {
$content_array = self::get_suggested_policy_text();
$content = '';
$toc = array( '<li><a href="#wp-privacy-policy-guide-introduction">' . __( 'Introduction' ) . '</a></li>' );
$date_format = __( 'F j, Y' );
foreach ( $content_array as $section ) {
@ -384,79 +383,56 @@ final class WP_Privacy_Policy_Content {
$removed = '';
if ( ! empty( $section['removed'] ) ) {
$class = 'text-removed';
$date = date_i18n( $date_format, $section['removed'] );
$badge_class = ' red';
$date = date_i18n( $date_format, $section['removed'] );
/* translators: %s: Date of plugin deactivation. */
$meta = sprintf( __( 'Removed %s.' ), $date );
$badge_title = sprintf( __( 'Removed %s.' ), $date );
/* translators: %s: Date of plugin deactivation. */
$removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
$removed = '<div class="notice notice-info inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
} elseif ( ! empty( $section['updated'] ) ) {
$class = 'text-updated';
$date = date_i18n( $date_format, $section['updated'] );
$badge_class = ' blue';
$date = date_i18n( $date_format, $section['updated'] );
/* translators: %s: Date of privacy policy text update. */
$meta = sprintf( __( 'Updated %s.' ), $date );
}
if ( $meta ) {
$meta = '<br><span class="privacy-text-meta">' . $meta . '</span>';
$badge_title = sprintf( __( 'Updated %s.' ), $date );
}
$plugin_name = esc_html( $section['plugin_name'] );
$toc_id = 'wp-privacy-policy-guide-' . sanitize_title( $plugin_name );
$toc[] = sprintf( '<li><a href="#%1$s">%2$s</a>' . $meta . '</li>', $toc_id, $plugin_name );
$content .= '<div class="privacy-text-section ' . $class . '">';
$content .= '<a id="' . $toc_id . '">&nbsp;</a>';
/* translators: %s: Plugin name. */
$content .= '<h2>' . sprintf( __( 'Source: %s' ), $plugin_name ) . '</h2>';
$content .= $removed;
$content .= '<div class="policy-text">' . $section['policy_text'] . '</div>';
if ( empty( $section['removed'] ) ) {
$content .= '<div class="privacy-text-actions">';
$content .= '<button type="button" class="privacy-text-copy button">';
$content .= __( 'Copy this section to clipboard' );
$content .= '</button>';
$content .= '<span class="success" aria-hidden="true">' . __( 'Copied!' ) . '</span>';
$content .= '</div>';
}
$content .= '<a href="#wpbody" class="return-to-top"><span aria-hidden="true">&uarr; </span> ' . __( 'Go to top' ) . '</a>';
$content .= '</div>'; // End of .privacy-text-section.
}
if ( count( $toc ) > 2 ) {
$sanitized_policy_name = sanitize_title_with_dashes( $plugin_name );
?>
<div class="privacy-text-box-toc">
<p><?php _e( 'Table of Contents' ); ?></p>
<ol>
<?php echo implode( $toc ); ?>
</ol>
<h4 class="privacy-settings-accordion-heading">
<button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" type="button">
<span class="title"><?php echo $plugin_name; ?></span>
<?php if ( ! empty( $section['removed'] ) || ! empty( $section['updated'] ) ) : ?>
<span class="badge <?php echo $badge_class; ?>"> <?php echo $badge_title; ?></span>
<?php endif; ?>
<span class="icon"></span>
</button>
</h4>
<div id="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" class="privacy-settings-accordion-panel privacy-text-box-body" hidden="hidden">
<?php
echo $removed;
echo $section['policy_text'];
?>
<?php if ( empty( $section['removed'] ) ) : ?>
<div class="privacy-settings-accordion-actions">
<span class="success" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
<button type="button" class="privacy-text-copy button">
<?php _e( 'Copy suggested policy text to clipboard' ); ?>
<span class="screen-reader-text">
<?php
/* translators: %s: Plugin name. */
sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name );
?>
</span>
</button>
</div>
<?php endif; ?>
</div>
<?php
}
?>
<div class="privacy-text-box">
<div class="privacy-text-box-head">
<a id="wp-privacy-policy-guide-introduction">&nbsp;</a>
<h2><?php _e( 'Introduction' ); ?></h2>
<p><?php _e( 'Hello,' ); ?></p>
<p><?php _e( 'This text template will help you to create your web site&#8217;s privacy policy.' ); ?></p>
<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>
<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>
<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>
</div>
<div class="privacy-text-box-body">
<?php echo $content; ?>
</div>
</div>
<?php
}
/**
@ -470,7 +446,7 @@ final class WP_Privacy_Policy_Content {
* @return string The default policy content.
*/
public static function get_default_content( $description = false, $blocks = true ) {
$suggested_text = $description ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : '';
$suggested_text = '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>';
$content = '';
$strings = array();
@ -487,15 +463,14 @@ final class WP_Privacy_Policy_Content {
$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>';
/* translators: Privacy policy tutorial. */
$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>';
} else {
/* translators: Default privacy policy text. %s: Site URL. */
$strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';
}
/* translators: Default privacy policy text. %s: Site URL. */
$strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
if ( $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
/* translators: Privacy policy tutorial. */
$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>';
/* translators: Privacy policy tutorial. */
@ -509,65 +484,65 @@ final class WP_Privacy_Policy_Content {
}
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'Comments' ) . '</h3>';
$strings[] = '<h2>' . __( 'Comments' ) . '</h2>';
if ( $description ) {
/* translators: Privacy policy tutorial. */
$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>';
} else {
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
}
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'Media' ) . '</h3>';
$strings[] = '<h2>' . __( 'Media' ) . '</h2>';
if ( $description ) {
/* translators: Privacy policy tutorial. */
$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>';
} else {
/* translators: Default privacy policy text. */
$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>';
}
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'Contact forms' ) . '</h3>';
if ( $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'Contact forms' ) . '</h2>';
/* translators: Privacy policy tutorial. */
$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>';
}
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'Cookies' ) . '</h3>';
$strings[] = '<h2>' . __( 'Cookies' ) . '</h2>';
if ( $description ) {
/* translators: Privacy policy tutorial. */
$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>';
} else {
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
}
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'Embedded content from other websites' ) . '</h3>';
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'Analytics' ) . '</h3>';
if ( ! $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'Embedded content from other websites' ) . '</h2>';
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
}
if ( $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'Analytics' ) . '</h2>';
/* translators: Privacy policy tutorial. */
$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>';
/* translators: Privacy policy tutorial. */
@ -582,35 +557,35 @@ final class WP_Privacy_Policy_Content {
$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>';
/* translators: Privacy policy tutorial. */
$strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';
} else {
/* translators: Default privacy policy text. */
$strings[] = '<p>' . $suggested_text . __( 'If you request a password reset, your IP address will be included in the reset email.' ) . '</p>';
}
/* translators: Default privacy policy text. */
$strings[] = '<p>' . $suggested_text . __( 'If you request a password reset, your IP address will be included in the reset email.' ) . '</p>';
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>';
if ( $description ) {
/* translators: Privacy policy tutorial. */
$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>';
} else {
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
}
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'What rights you have over your data' ) . '</h2>';
if ( $description ) {
/* translators: Privacy policy tutorial. */
$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>';
} else {
/* translators: Default privacy policy text. */
$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>';
}
/* translators: Default privacy policy text. */
$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>';
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'Where we send your data' ) . '</h2>';
@ -619,63 +594,56 @@ final class WP_Privacy_Policy_Content {
$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>';
/* translators: Privacy policy tutorial. */
$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>';
} else {
/* translators: Default privacy policy text. */
$strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
}
/* translators: Default privacy policy text. */
$strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'Contact information' ) . '</h2>';
if ( $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'Contact information' ) . '</h2>';
/* translators: Privacy policy tutorial. */
$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>';
}
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';
if ( $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';
/* translators: Privacy policy tutorial. */
$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>';
}
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'How we protect your data' ) . '</h3>';
if ( $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'How we protect your data' ) . '</h2>';
/* translators: Privacy policy tutorial. */
$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>';
}
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
if ( $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'What data breach procedures we have in place' ) . '</h2>';
/* translators: Privacy policy tutorial. */
$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>';
}
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
if ( $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'What third parties we receive data from' ) . '</h2>';
/* translators: Privacy policy tutorial. */
$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>';
}
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
if ( $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h2>';
/* translators: Privacy policy tutorial. */
$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>';
}
/* translators: Default privacy policy heading. */
$strings[] = '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
if ( $description ) {
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'Industry regulatory disclosure requirements' ) . '</h2>';
/* translators: Privacy policy tutorial. */
$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>';
$strings[] = '</div>';
@ -690,10 +658,6 @@ final class WP_Privacy_Policy_Content {
if ( 0 === strpos( $string, '<h2>' ) ) {
$strings[ $key ] = '<!-- wp:heading -->' . $string . '<!-- /wp:heading -->';
}
if ( 0 === strpos( $string, '<h3>' ) ) {
$strings[ $key ] = '<!-- wp:heading {"level":3} -->' . $string . '<!-- /wp:heading -->';
}
}
}
@ -706,12 +670,14 @@ final class WP_Privacy_Policy_Content {
* @since 4.9.6
* @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters.
*
* @deprecated 5.7.0 This filter has been deprecated.
*
* @param string $content The default policy content.
* @param string[] $strings An array of privacy policy content strings.
* @param bool $description Whether policy descriptions should be included.
* @param bool $blocks Whether the content should be formatted for the block editor.
*/
return apply_filters( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks );
return apply_filters_deprecated( 'wp_get_default_privacy_policy_content', array( $content, $strings, $description, $blocks ), '5.7.0', false );
}
/**
@ -720,7 +686,7 @@ final class WP_Privacy_Policy_Content {
* @since 4.9.6
*/
public static function add_suggested_content() {
$content = self::get_default_content( true, false );
$content = self::get_default_content( false, false );
wp_add_privacy_policy_content( __( 'WordPress' ), $content );
}
}

View File

@ -275,7 +275,6 @@ jQuery( document ).ready( function( $ ) {
// Privacy Policy page, copy action.
$( document ).on( 'click', function( event ) {
var $parent,
$container,
range,
$target = $( event.target ),
copiedNotice = $target.siblings( '.success' );
@ -283,14 +282,9 @@ jQuery( document ).ready( function( $ ) {
clearTimeout( copiedNoticeTimeout );
if ( $target.is( 'button.privacy-text-copy' ) ) {
$parent = $target.parent().parent();
$container = $parent.find( 'div.wp-suggested-text' );
$parent = $target.closest( '.privacy-settings-accordion-panel' );
if ( ! $container.length ) {
$container = $parent.find( 'div.policy-text' );
}
if ( $container.length ) {
if ( $parent.length ) {
try {
var documentPosition = document.documentElement.scrollTop,
bodyPosition = document.body.scrollTop;
@ -300,15 +294,15 @@ jQuery( document ).ready( function( $ ) {
// Hide tutorial content to remove from copied content.
range = document.createRange();
$container.addClass( 'hide-privacy-policy-tutorial' );
$parent.addClass( 'hide-privacy-policy-tutorial' );
// Copy action.
range.selectNodeContents( $container[0] );
range.selectNodeContents( $parent[0] );
window.getSelection().addRange( range );
document.execCommand( 'copy' );
// Reset section.
$container.removeClass( 'hide-privacy-policy-tutorial' );
$parent.removeClass( 'hide-privacy-policy-tutorial' );
window.getSelection().removeAllRanges();
// Return scroll position - see #49540.
@ -320,7 +314,7 @@ jQuery( document ).ready( function( $ ) {
// Display and speak notice to indicate action complete.
copiedNotice.addClass( 'visible' );
wp.a11y.speak( __( 'The section has been copied to your clipboard.' ) );
wp.a11y.speak( __( 'The suggested policy text has been copied to your clipboard.' ) );
// Delay notice dismissal.
copiedNoticeTimeout = setTimeout( function() {
@ -330,4 +324,23 @@ jQuery( document ).ready( function( $ ) {
}
}
});
// Label handling to focus the create page button on Privacy settings page.
$( 'body.options-privacy-php label[for=create-page]' ).on( 'click', function( e ) {
e.preventDefault();
$( 'input#create-page' ).focus();
} );
// Accordion handling in various new Privacy settings pages.
$( '.privacy-settings-accordion' ).on( 'click', '.privacy-settings-accordion-trigger', function() {
var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) );
if ( isExpanded ) {
$( this ).attr( 'aria-expanded', 'false' );
$( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', true );
} else {
$( this ).attr( 'aria-expanded', 'true' );
$( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', false );
}
} );
});

File diff suppressed because one or more lines are too long

View File

@ -13,6 +13,20 @@ if ( ! current_user_can( 'manage_privacy_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) );
}
if ( isset( $_GET['tab'] ) && 'policyguide' === $_GET['tab'] ) {
require_once( dirname( __FILE__ ) . '/privacy-policy-guide.php' );
return;
}
add_filter(
'admin_body_class',
function( $body_class ) {
$body_class .= ' privacy-settings ';
return $body_class;
}
);
$action = isset( $_POST['action'] ) ? $_POST['action'] : '';
if ( ! empty( $action ) ) {
@ -112,15 +126,45 @@ if ( ! empty( $privacy_policy_page_id ) ) {
}
}
$title = __( 'Privacy Settings' );
$parent_file = 'options-general.php';
wp_enqueue_script( 'privacy-tools' );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php echo $title; ?></h1>
<h2><?php _e( 'Privacy Policy Page' ); ?></h2>
<div class="privacy-settings-header">
<div class="privacy-settings-title-section">
<h1>
<?php _e( 'Privacy' ); ?>
</h1>
</div>
<nav class="privacy-settings-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
<a href="<?php echo esc_url( admin_url( 'options-privacy.php' ) ); ?>" class="privacy-settings-tab active" aria-current="true">
<?php
/* translators: Tab heading for Site Health Status page. */
_ex( 'Settings', 'Privacy Settings' );
?>
</a>
<a href="<?php echo esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); ?>" class="privacy-settings-tab">
<?php
/* translators: Tab heading for Site Health Status page. */
_ex( 'Policy Guide', 'Privacy Settings' );
?>
</a>
</nav>
</div>
<hr class="wp-header-end">
<div class="notice notice-error hide-if-js">
<p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p>
</div>
<div class="privacy-settings-body hide-if-no-js">
<h2><?php _e( 'Privacy Settings' ); ?></h2>
<p>
<?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.' ); ?>
<?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?>
@ -133,55 +177,85 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?>
<?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.' ); ?>
</p>
<?php
if ( $privacy_policy_page_exists ) {
$edit_href = add_query_arg(
array(
'post' => $privacy_policy_page_id,
'action' => 'edit',
),
admin_url( 'post.php' )
);
$view_href = get_permalink( $privacy_policy_page_id );
?>
<p class="tools-privacy-edit"><strong>
<?php
if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {
printf(
/* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page. */
__( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ),
esc_url( $edit_href ),
esc_url( $view_href )
);
} else {
printf(
/* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page. */
__( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ),
esc_url( $edit_href ),
esc_url( $view_href )
);
}
?>
</strong></p>
<?php
}
?>
<p>
<?php
if ( $privacy_policy_page_exists ) {
$edit_href = add_query_arg(
array(
'post' => $privacy_policy_page_id,
'action' => 'edit',
),
admin_url( 'post.php' )
);
$view_href = get_permalink( $privacy_policy_page_id );
?>
<strong>
<?php
if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {
printf(
/* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page. */
__( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ),
esc_url( $edit_href ),
esc_url( $view_href )
);
} else {
printf(
/* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page. */
__( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ),
esc_url( $edit_href ),
esc_url( $view_href )
);
}
?>
</strong>
<?php
}
printf(
/* translators: 1: Privacy Policy guide URL, 2: Additional link attributes, 3: Accessibility text. */
__( '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.' ),
esc_url( admin_url( 'privacy-policy-guide.php' ) ),
__( '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.' ),
esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ),
'',
''
);
?>
</p>
<hr>
<?php
$has_pages = (bool) get_posts(
array(
'post_type' => 'page',
'posts_per_page' => 1,
'post_status' => array(
'publish',
'draft',
),
)
);
?>
<table class="form-table tools-privacy-policy-page" role="presentation">
<tr>
<th scope="row">
<label for="create-page">
<?php
if ( $has_pages ) {
_e( 'Create a new Privacy Policy Page' );
} else {
_e( 'There are no pages.' );
}
?>
</label>
</th>
<td>
<form class="wp-create-privacy-page" method="post" action="">
<input type="hidden" name="action" value="create-privacy-page" />
<?php
wp_nonce_field( 'create-privacy-page' );
submit_button( __( 'Create' ), 'secondary', 'submit', false, array( 'id' => 'create-page' ) );
?>
</form>
</td>
</tr>
<?php if ( $has_pages ) : ?>
<tr>
<th scope="row">
<label for="page_for_privacy_policy">
@ -195,59 +269,27 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
</label>
</th>
<td>
<?php
$has_pages = (bool) get_posts(
array(
'post_type' => 'page',
'posts_per_page' => 1,
'post_status' => array(
'publish',
'draft',
),
)
);
if ( $has_pages ) :
?>
<form method="post" action="">
<input type="hidden" name="action" value="set-privacy-page" />
<?php
wp_dropdown_pages(
array(
'name' => 'page_for_privacy_policy',
'show_option_none' => __( '&mdash; Select &mdash;' ),
'option_none_value' => '0',
'selected' => $privacy_policy_page_id,
'post_status' => array( 'draft', 'publish' ),
)
);
wp_nonce_field( 'set-privacy-page' );
submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );
?>
</form>
<?php endif; ?>
<form class="wp-create-privacy-page" method="post" action="">
<input type="hidden" name="action" value="create-privacy-page" />
<span>
<?php
if ( $has_pages ) {
_e( 'Or' );
} else {
_e( 'There are no pages.' );
}
?>
</span>
<form method="post" action="">
<input type="hidden" name="action" value="set-privacy-page" />
<?php
wp_nonce_field( 'create-privacy-page' );
wp_dropdown_pages(
array(
'name' => 'page_for_privacy_policy',
'show_option_none' => __( '&mdash; Select &mdash;' ),
'option_none_value' => '0',
'selected' => $privacy_policy_page_id,
'post_status' => array( 'draft', 'publish' ),
)
);
submit_button( __( 'Create New Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) );
wp_nonce_field( 'set-privacy-page' );
submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) );
?>
</form>
</td>
</tr>
<?php endif; ?>
</table>
</div>
<?php

View File

@ -17,17 +17,74 @@ if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
include_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';
}
$title = __( 'Privacy Policy Guide' );
add_filter(
'admin_body_class',
function( $body_class ) {
$body_class .= ' privacy-settings ';
return $body_class;
}
);
wp_enqueue_script( 'privacy-tools' );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<div class="privacy-settings-header">
<div class="privacy-settings-title-section">
<h1>
<?php _e( 'Privacy' ); ?>
</h1>
</div>
<div class="wp-privacy-policy-guide">
<nav class="privacy-settings-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
<a href="<?php echo esc_url( admin_url( 'options-privacy.php' ) ); ?>" class="privacy-settings-tab">
<?php
/* translators: Tab heading for Site Health Status page. */
_ex( 'Settings', 'Privacy Settings' );
?>
</a>
<a href="<?php echo esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); ?>" class="privacy-settings-tab active" aria-current="true">
<?php
/* translators: Tab heading for Site Health Status page. */
_ex( 'Policy Guide', 'Privacy Settings' );
?>
</a>
</nav>
</div>
<hr class="wp-header-end">
<div class="notice notice-error hide-if-js">
<p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p>
</div>
<div class="privacy-settings-body hide-if-no-js">
<h2><?php _e( 'Privacy Policy Guide' ); ?></h2>
<h3 class="section-title"><?php _e( 'Introduction' ); ?></h3>
<p><?php _e( 'This text template will help you to create your web site&#8217;s privacy policy.' ); ?></p>
<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>
<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>
<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>
<div class="privacy-settings-accordion">
<h4 class="privacy-settings-accordion-heading">
<button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-privacy-policy-guide" type="button">
<span class="title"><?php _e( 'Privacy Policy Guide' ); ?></span>
<span class="icon"></span>
</button>
</h4>
<div id="privacy-settings-accordion-block-privacy-policy-guide" class="privacy-settings-accordion-panel" hidden="hidden">
<?php
$content = WP_Privacy_Policy_Content::get_default_content( true, false );
echo $content;
?>
</div>
</div>
<hr class="hr-separator">
<h3 class="section-title"><?php _e( 'Policies' ); ?></h3>
<div class="privacy-settings-accordion wp-privacy-policy-guide">
<?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>
</div>
</div>

View File

@ -21,7 +21,7 @@ if ( isset( $_GET['page'] ) && ! empty( $_POST ) ) {
// The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php.
if ( isset( $_GET['wp-privacy-policy-guide'] ) ) {
require_once dirname( __DIR__ ) . '/wp-load.php';
wp_redirect( admin_url( 'privacy-policy-guide.php' ), 301 );
wp_redirect( admin_url( 'options-privacy.php?tab=policyguide' ), 301 );
exit;
} elseif ( isset( $_GET['page'] ) ) {
// These were also moved to files in WP 5.3.

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-alpha-50160';
$wp_version = '5.7-alpha-50161';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.