Ticket #49264: 49264.2.diff
File 49264.2.diff, 26.6 KB (added by , 5 years 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( $ ) { 77 77 78 78 appendResultsAfterRow( $requestRow, 'notice-success', summaryMessage, [] ); 79 79 $this.hide(); 80 80 81 81 if ( 'undefined' !== typeof zipUrl ) { 82 82 window.location = zipUrl; 83 83 } else if ( ! sendAsEmail ) { … … jQuery( document ).ready( function( $ ) { 259 259 } 260 260 } 261 261 }); 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 } ); 262 283 }); 263 284 -
src/wp-admin/css/edit.css
diff --git a/src/wp-admin/css/edit.css b/src/wp-admin/css/edit.css index 20d4c4d27a..0a560cec77 100644
a b form#tags-filter { 658 658 min-height: 1.6923em; 659 659 } 660 660 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 .privacy-policy-tutorial {733 visibility: hidden;734 }735 736 .wp-suggested-text p {737 font-style: italic;738 }739 740 .wp-suggested-text p.privacy-policy-tutorial {741 font-style: normal;742 }743 744 .notice.wp-pp-notice {745 margin: 15px 0 3px;746 }747 748 661 /*------------------------------------------------------------------------------ 749 662 11.1 - Custom Fields 750 663 ------------------------------------------------------------------------------*/ -
new file src/wp-admin/css/privacy-settings.css
diff --git a/src/wp-admin/css/privacy-settings.css b/src/wp-admin/css/privacy-settings.css new file mode 100644 index 0000000000..6cd9ee0731
- + 1 /* General */ 2 .options-privacy-php #wpcontent, 3 .privacy-policy-guide-php #wpcontent, 4 .privacy-policy-guide-php.auto-fold #wpcontent, 5 .options-privacy-php.auto-fold #wpcontent { 6 padding-left: 0; 7 } 8 9 .privacy-settings-header h1 { 10 display: inline-block; 11 font-weight: 600; 12 margin: 0 0.8rem 1rem; 13 font-size: 23px; 14 padding: 9px 0 4px 0; 15 line-height: 1.3; 16 } 17 18 .privacy-settings-body h2 { 19 padding: 1rem 0; 20 line-height: 1.4; 21 } 22 23 .privacy-settings-body h3 { 24 padding: 0; 25 font-weight: 400; 26 } 27 28 /* Header */ 29 .privacy-settings-header { 30 text-align: center; 31 margin: 0 0 1rem; 32 background: #fff; 33 border-bottom: 1px solid #e2e4e7; 34 } 35 36 .privacy-settings-title-section { 37 display: flex; 38 align-items: center; 39 justify-content: center; 40 clear: both; 41 } 42 43 .privacy-settings-tabs-wrapper { 44 /* IE 11 */ 45 display: -ms-inline-grid; 46 -ms-grid-columns: 1fr 1fr; 47 vertical-align: top; 48 /* modern browsers */ 49 display: inline-grid; 50 grid-template-columns: 1fr 1fr; 51 } 52 53 .privacy-settings-tab { 54 display: block; /* IE 11 */ 55 text-decoration: none; 56 color: inherit; 57 padding: 0.5rem 1rem 1rem; 58 margin: 0 1rem; 59 transition: box-shadow 0.5s ease-in-out; 60 } 61 62 .privacy-settings-tab:nth-child(1) { 63 -ms-grid-column: 1; /* IE 11 */ 64 } 65 66 .privacy-settings-tab:nth-child(2) { 67 -ms-grid-column: 2; /* IE 11 */ 68 } 69 70 .privacy-settings-tab:focus { 71 color: #191e23; 72 outline: 1px solid #6c7781; 73 box-shadow: none; 74 } 75 76 .privacy-settings-tab.active { 77 box-shadow: inset 0 -3px #007cba; 78 font-weight: 600; 79 } 80 81 /* Body */ 82 .privacy-settings-body { 83 max-width: 800px; 84 margin: 0 auto; 85 } 86 87 .tools-privacy-policy-page th { 88 min-width: 230px; 89 } 90 91 .hr-separator { 92 margin-top: 20px; 93 margin-bottom: 15px; 94 } 95 96 /* Accordions */ 97 .privacy-settings-accordion { 98 border: 1px solid #ccd0d4; 99 } 100 101 .privacy-settings-accordion-heading { 102 margin: 0; 103 border-top: 1px solid #ccd0d4; 104 font-size: inherit; 105 line-height: inherit; 106 font-weight: 600; 107 color: inherit; 108 } 109 110 .privacy-settings-accordion-heading:first-child { 111 border-top: none; 112 } 113 114 .privacy-settings-accordion-trigger { 115 background: #fff; 116 border: 0; 117 color: #32373c; 118 cursor: pointer; 119 display: flex; 120 font-weight: 400; 121 margin: 0; 122 padding: 1em 3.5em 1em 1.5em; 123 min-height: 46px; 124 position: relative; 125 text-align: left; 126 width: 100%; 127 align-items: center; 128 justify-content: space-between; 129 } 130 131 .privacy-settings-accordion-trigger:hover, 132 .privacy-settings-accordion-trigger:active { 133 background: #f8f9f9; 134 } 135 136 .privacy-settings-accordion-trigger:focus { 137 color: #191e23; 138 border: none; 139 box-shadow: none; 140 outline-offset: -2px; 141 outline: 1px dotted #555d66; 142 } 143 144 .privacy-settings-accordion-trigger .title { 145 pointer-events: none; 146 font-weight: 600; 147 flex-grow: 1; 148 } 149 150 .privacy-settings-accordion-trigger .icon, 151 .privacy-settings-view-read .icon { 152 border: solid #555d66; 153 border-width: 0 2px 2px 0; 154 height: 0.5rem; 155 pointer-events: none; 156 position: absolute; 157 right: 1.5em; 158 top: 50%; 159 transform: translateY(-70%) rotate(45deg); 160 width: 0.5rem; 161 } 162 163 .privacy-settings-accordion-trigger[aria-expanded="true"] .icon, 164 .privacy-settings-view-passed[aria-expanded="true"] .icon { 165 transform: translateY(-30%) rotate(-135deg) 166 } 167 168 .privacy-settings-accordion-panel { 169 margin: 0; 170 padding: 1em 1.5em; 171 background: #fff; 172 } 173 174 .privacy-settings-accordion-panel[hidden] { 175 display: none; 176 } 177 178 .privacy-settings-accordion-panel a .dashicons { 179 text-decoration: none; 180 } 181 182 /* Suggested text for privacy policy */ 183 .wp-suggested-text h2 { 184 padding: 0; 185 } 186 187 .wp-suggested-text h2:first-child { 188 margin-top: 0; 189 } 190 191 192 .wp-suggested-text .privacy-suggested-text { 193 font-weight: 600; 194 } 195 196 /* Media queries */ 197 @media screen and (max-width: 782px) { 198 199 .privacy-settings-body { 200 margin: 0 12px; 201 width: auto; 202 } 203 204 .privacy-settings-tabs-wrapper { 205 grid-template-columns: 1fr; 206 } 207 208 input#create-page { 209 margin-top: 10px; 210 } 211 } -
src/wp-admin/includes/admin-filters.php
diff --git a/src/wp-admin/includes/admin-filters.php b/src/wp-admin/includes/admin-filters.php index c080fd0f24..a82ec8fd9f 100644
a b add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check 140 140 // Show a "postbox" with the text suggestions for a privacy policy. 141 141 add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'notice' ) ); 142 142 143 // Add the suggested policy text from WordPress.144 add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 1 );145 146 143 // Update the cached policy info when the policy page is updated. 147 144 add_action( 'post_updated', array( 'WP_Privacy_Policy_Content', '_policy_page_updated' ) ); 148 145 -
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..561d25b549 100644
a b final class WP_Privacy_Policy_Content { 142 142 printf( 143 143 /* translators: %s: Privacy Policy Guide URL. */ 144 144 __( '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' ) ) 146 146 ); 147 147 ?> 148 148 </p> … … final class WP_Privacy_Policy_Content { 325 325 } 326 326 327 327 $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' ) ); 329 329 $label = __( 'View Privacy Policy Guide.' ); 330 330 331 331 if ( get_current_screen()->is_block_editor() ) { … … final class WP_Privacy_Policy_Content { 373 373 $content_array = self::get_suggested_policy_text(); 374 374 375 375 $content = ''; 376 $toc = array( '<li><a href="#wp-privacy-policy-guide-introduction">' . __( 'Introduction' ) . '</a></li>' );377 376 $date_format = __( 'F j, Y' ); 378 377 $copy = __( 'Copy this section to clipboard' ); 379 $return_to_top = '<a href="#" class="return-to-top">' . __( '↑ Return to Top' ) . '</a>';380 378 381 379 foreach ( $content_array as $section ) { 382 380 $class = ''; … … final class WP_Privacy_Policy_Content { 404 402 } 405 403 406 404 $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 405 410 406 $content .= '<div class="privacy-text-section' . $class . '">'; 411 $content .= '<a id="' . $toc_id . '"> </a>';412 407 /* translators: %s: Plugin name. */ 413 408 $content .= '<h2>' . sprintf( __( 'Source: %s' ), $plugin_name ) . '</h2>'; 414 409 $content .= $removed; 415 410 416 411 $content .= '<div class="policy-text">' . $section['policy_text'] . '</div>'; 417 $content .= $return_to_top;418 412 419 413 if ( empty( $section['removed'] ) ) { 420 414 $content .= '<div class="privacy-text-actions">'; … … final class WP_Privacy_Policy_Content { 429 423 } 430 424 431 425 $content .= "</div>\n"; // End of .privacy-text-section. 432 }433 426 434 if ( count( $toc ) > 2 ) {427 $sanitized_policy_name = sanitize_title_with_dashes( $plugin_name ); 435 428 ?> 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> 429 <h4 class="privacy-settings-accordion-heading"> 430 <button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" type="button"> 431 <span class="title"><?php echo $plugin_name ?></span> 432 <span class="icon"></span> 433 </button> 434 </h4> 435 <div id="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" class="privacy-settings-accordion-panel privacy-text-box-body" hidden="hidden"> 436 <?php echo $content; ?> 437 <div class="actions"> 438 <p> Copy ! </p> 439 </div> 441 440 </div> 442 441 <?php 443 442 } 444 445 ?>446 <div class="privacy-text-box">447 <div class="privacy-text-box-head">448 <a id="wp-privacy-policy-guide-introduction"> </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’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 <?php462 443 } 463 444 464 445 /** … … final class WP_Privacy_Policy_Content { 712 693 */ 713 694 return apply_filters( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks ); 714 695 } 715 716 /**717 * Add the suggested privacy policy text to the policy postbox.718 *719 * @since 4.9.6720 */721 public static function add_suggested_content() {722 $content = self::get_default_content( true, false );723 wp_add_privacy_policy_content( __( 'WordPress' ), $content );724 }725 696 } -
src/wp-admin/options-privacy.php
diff --git a/src/wp-admin/options-privacy.php b/src/wp-admin/options-privacy.php index 95492b326f..b65d5cbd82 100644
a b if ( ! current_user_can( 'manage_privacy_options' ) ) { 13 13 wp_die( __( 'Sorry, you are not allowed to manage privacy on this site.' ) ); 14 14 } 15 15 16 17 if ( isset( $_GET['tab'] ) && 'policyguide' === $_GET['tab'] ) { 18 require_once( dirname( __FILE__ ) . '/privacy-policy-guide.php' ); 19 return; 20 } 21 16 22 $action = isset( $_POST['action'] ) ? $_POST['action'] : ''; 17 23 18 24 if ( ! empty( $action ) ) { … … if ( ! empty( $privacy_policy_page_id ) ) { 112 118 } 113 119 } 114 120 115 $title = __( 'Privacy Settings' );116 121 $parent_file = 'options-general.php'; 117 122 123 wp_enqueue_style( 'privacy-settings' ); 124 wp_enqueue_script( 'privacy-tools' ); 125 118 126 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 119 127 120 128 ?> 121 <div class="wrap"> 122 <h1><?php echo $title; ?></h1> 123 <h2><?php _e( 'Privacy Policy Page' ); ?></h2> 129 <div class="privacy-settings-header"> 130 <div class="privacy-settings-title-section"> 131 <h1> 132 <?php _e( 'Privacy' ); ?> 133 </h1> 134 </div> 135 136 <nav class="privacy-settings-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>"> 137 <a href="<?php echo esc_url( admin_url( 'options-privacy.php' ) ); ?>" class="privacy-settings-tab active" aria-current="true"> 138 <?php 139 /* translators: Tab heading for Site Health Status page. */ 140 _ex( 'Settings', 'Privacy Settings' ); 141 ?> 142 </a> 143 144 <a href="<?php echo esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); ?>" class="privacy-settings-tab"> 145 <?php 146 /* translators: Tab heading for Site Health Status page. */ 147 _ex( 'Policy Guide', 'Privacy Settings' ); 148 ?> 149 </a> 150 </nav> 151 </div> 152 153 <hr class="wp-header-end"> 154 155 <div class="notice notice-error hide-if-js"> 156 <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p> 157 </div> 158 159 <div class="privacy-settings-body hide-if-no-js"> 160 <h2><?php _e( 'Privacy Settings' ); ?></h2> 124 161 <p> 125 162 <?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.' ); ?> 126 163 <?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' ); 133 170 <?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?> 134 171 <?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.' ); ?> 135 172 </p> 136 <?php137 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 <?php151 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 <?php169 }170 ?>171 173 <p> 172 174 <?php 175 if ( $privacy_policy_page_exists ) { 176 $edit_href = add_query_arg( 177 array( 178 'post' => $privacy_policy_page_id, 179 'action' => 'edit', 180 ), 181 admin_url( 'post.php' ) 182 ); 183 184 $view_href = get_permalink( $privacy_policy_page_id ); 185 ?> 186 <strong> 187 <?php 188 if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) { 189 printf( 190 /* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page. */ 191 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ), 192 esc_url( $edit_href ), 193 esc_url( $view_href ) 194 ); 195 } else { 196 printf( 197 /* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page. */ 198 __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ), 199 esc_url( $edit_href ), 200 esc_url( $view_href ) 201 ); 202 } 203 ?> 204 </strong> 205 <?php 206 } 173 207 printf( 174 208 /* 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' ) ),209 __( '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.' ), 210 esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ), 177 211 '', 178 212 '' 179 213 ); … … require_once( ABSPATH . 'wp-admin/admin-header.php' ); 181 215 </p> 182 216 183 217 <hr> 218 219 <?php 220 $has_pages = (bool) get_posts( 221 array( 222 'post_type' => 'page', 223 'posts_per_page' => 1, 224 'post_status' => array( 225 'publish', 226 'draft', 227 ), 228 ) 229 ); 230 ?> 231 184 232 <table class="form-table tools-privacy-policy-page" role="presentation"> 233 <tr> 234 <th scope="row"> 235 <label for="create-page"> 236 <?php 237 if ( $has_pages ) { 238 _e( 'Create a new Privacy Policy Page' ); 239 } else { 240 _e( 'There are no pages.' ); 241 } 242 ?> 243 </label> 244 </td> 245 <td> 246 <form class="wp-create-privacy-page" method="post" action=""> 247 <input type="hidden" name="action" value="create-privacy-page" /> 248 <?php 249 wp_nonce_field( 'create-privacy-page' ); 250 251 submit_button( __( 'Create' ), 'secondary', 'submit', false, array( 'id' => 'create-page' ) ); 252 ?> 253 </form> 254 </td> 255 </tr> 256 <?php if ( $has_pages ) : ?> 185 257 <tr> 186 258 <th scope="row"> 187 259 <label for="page_for_privacy_policy"> … … require_once( ABSPATH . 'wp-admin/admin-header.php' ); 195 267 </label> 196 268 </th> 197 269 <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' => __( '— Select —' ), 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> 270 <form method="post" action=""> 271 <input type="hidden" name="action" value="set-privacy-page" /> 243 272 <?php 244 wp_nonce_field( 'create-privacy-page' ); 273 wp_dropdown_pages( 274 array( 275 'name' => 'page_for_privacy_policy', 276 'show_option_none' => __( '— Select —' ), 277 'option_none_value' => '0', 278 'selected' => $privacy_policy_page_id, 279 'post_status' => array( 'draft', 'publish' ), 280 ) 281 ); 245 282 246 submit_button( __( 'Create New Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) ); 283 wp_nonce_field( 'set-privacy-page' ); 284 285 submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) ); 247 286 ?> 248 287 </form> 249 288 </td> 250 289 </tr> 290 <?php endif; ?> 251 291 </table> 292 252 293 </div> 253 294 <?php 254 295 -
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..d424f400b4 100644
a b if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { 19 19 20 20 $title = __( 'Privacy Policy Guide' ); 21 21 22 wp_enqueue_style( 'privacy-settings' ); 22 23 wp_enqueue_script( 'privacy-tools' ); 23 24 24 25 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 25 26 26 27 ?> 27 <div class="wrap"> 28 <h1><?php echo esc_html( $title ); ?></h1> 28 <div class="privacy-settings-header"> 29 <div class="privacy-settings-title-section"> 30 <h1> 31 <?php _e( 'Privacy' ); ?> 32 </h1> 33 </div> 34 35 <nav class="privacy-settings-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>"> 36 <a href="<?php echo esc_url( admin_url( 'options-privacy.php' ) ); ?>" class="privacy-settings-tab"> 37 <?php 38 /* translators: Tab heading for Site Health Status page. */ 39 _ex( 'Settings', 'Privacy Settings' ); 40 ?> 41 </a> 42 43 <a href="<?php echo esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); ?>" class="privacy-settings-tab active" aria-current="true"> 44 <?php 45 /* translators: Tab heading for Site Health Status page. */ 46 _ex( 'Policy Guide', 'Privacy Settings' ); 47 ?> 48 </a> 49 </nav> 50 </div> 51 52 <hr class="wp-header-end"> 53 54 <div class="notice notice-error hide-if-js"> 55 <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p> 56 </div> 29 57 30 <div class="wp-privacy-policy-guide"> 58 <div class="privacy-settings-body hide-if-no-js"> 59 <h2><?php _e( 'Privacy Policy Guide' ); ?></h2> 60 <h3 class="section-title"><?php _e( 'Introduction' ); ?></h3> 61 <p><?php _e( 'This text template will help you to create your web site’s privacy policy.' ); ?></p> 62 <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> 63 <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> 64 <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> 65 66 <div class="privacy-settings-accordion"> 67 <h4 class="privacy-settings-accordion-heading"> 68 <button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-wordpress" type="button"> 69 <span class="title"><?php _e( 'WordPress' ); ?></span> 70 <span class="icon"></span> 71 </button> 72 </h4> 73 <div id="privacy-settings-accordion-block-wordpress" class="privacy-settings-accordion-panel" hidden="hidden"> 74 <?php 75 $content = WP_Privacy_Policy_Content::get_default_content( true, false ); 76 echo $content; 77 ?> 78 <div class="actions"> 79 <p> Copy ! </p> 80 </div> 81 </div> 82 </div> 83 84 <hr class="hr-separator"> 85 86 <h3 class="section-title"><?php _e( 'Policies' ); ?></h3> 87 88 <div class="privacy-settings-accordion wp-privacy-policy-guide"> 31 89 <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?> 32 90 </div> 33 </div> 91 </div> <!-- privacy-settings-body --> 92 34 93 <?php 35 94 36 95 include( 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' ); 23 23 24 24 // The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php. 25 25 if ( 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 ); 27 27 exit; 28 28 } elseif ( isset( $_GET['page'] ) ) { 29 29 // These were also moved to files in WP 5.3. -
src/wp-includes/script-loader.php
diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 018cb777af..e30dfc7f84 100644
a b function wp_default_styles( &$styles ) { 1730 1730 $styles->add( 'l10n', "/wp-admin/css/l10n$suffix.css" ); 1731 1731 $styles->add( 'code-editor', "/wp-admin/css/code-editor$suffix.css", array( 'wp-codemirror' ) ); 1732 1732 $styles->add( 'site-health', "/wp-admin/css/site-health$suffix.css" ); 1733 $styles->add( 'privacy-settings', "/wp-admin/css/privacy-settings$suffix.css" ); 1733 1734 1734 1735 $styles->add( 'wp-admin', false, array( 'dashicons', 'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus', 'widgets', 'site-icon', 'l10n' ) ); 1735 1736