Ticket #49264: 49264.7.diff
File 49264.7.diff, 55.7 KB (added by , 4 years ago) |
---|
-
src/js/_enqueues/admin/privacy-tools.js
275 275 // Privacy Policy page, copy action. 276 276 $( document ).on( 'click', function( event ) { 277 277 var $parent, 278 $container,279 278 range, 280 279 $target = $( event.target ), 281 280 copiedNotice = $target.siblings( '.success' ); … … 283 282 clearTimeout( copiedNoticeTimeout ); 284 283 285 284 if ( $target.is( 'button.privacy-text-copy' ) ) { 286 $parent = $target.parent().parent(); 287 $container = $parent.find( 'div.wp-suggested-text' ); 285 $parent = $target.closest( '.privacy-settings-accordion-panel' ); 288 286 289 if ( ! $container.length ) { 290 $container = $parent.find( 'div.policy-text' ); 291 } 292 293 if ( $container.length ) { 287 if ( $parent.length ) { 294 288 try { 295 289 var documentPosition = document.documentElement.scrollTop, 296 290 bodyPosition = document.body.scrollTop; … … 300 294 301 295 // Hide tutorial content to remove from copied content. 302 296 range = document.createRange(); 303 $ container.addClass( 'hide-privacy-policy-tutorial' );297 $parent.addClass( 'copy-suggested-text' ); 304 298 305 299 // Copy action. 306 range.selectNodeContents( $ container[0] );300 range.selectNodeContents( $parent[0] ); 307 301 window.getSelection().addRange( range ); 308 302 document.execCommand( 'copy' ); 309 303 310 304 // Reset section. 311 $ container.removeClass( 'hide-privacy-policy-tutorial' );305 $parent.removeClass( 'copy-suggested-text' ); 312 306 window.getSelection().removeAllRanges(); 313 307 314 308 // Return scroll position - see #49540. … … 320 314 321 315 // Display and speak notice to indicate action complete. 322 316 copiedNotice.addClass( 'visible' ); 323 wp.a11y.speak( __( 'The s ectionhas been copied to your clipboard.' ) );317 wp.a11y.speak( __( 'The suggested policy text has been copied to your clipboard.' ) ); 324 318 325 319 // Delay notice dismissal. 326 320 copiedNoticeTimeout = setTimeout( function() { … … 330 324 } 331 325 } 332 326 }); 327 328 // Label handling to focus the create page button on Privacy settings page. 329 $( 'body.options-privacy-php label[for=create-page]' ).on( 'click', function( e ) { 330 e.preventDefault(); 331 $( 'input#create-page' ).focus(); 332 } ); 333 334 // Accordion handling in various new Privacy settings pages. 335 $( '.privacy-settings-accordion' ).on( 'click', '.privacy-settings-accordion-trigger', function() { 336 var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) ); 337 338 if ( isExpanded ) { 339 $( this ).attr( 'aria-expanded', 'false' ); 340 $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', true ); 341 } else { 342 $( this ).attr( 'aria-expanded', 'true' ); 343 $( '#' + $( this ).attr( 'aria-controls' ) ).attr( 'hidden', false ); 344 } 345 } ); 333 346 }); -
src/wp-admin/css/common.css
3725 3725 text-decoration: none; 3726 3726 } 3727 3727 3728 /** 3729 * Privacy Settings section 3730 */ 3731 3732 /* General */ 3733 .privacy-settings #wpcontent, 3734 .privacy-settings.auto-fold #wpcontent { 3735 padding-left: 0; 3736 } 3737 3738 .privacy-settings-header h1 { 3739 display: inline-block; 3740 font-weight: 600; 3741 margin: 0 0.8rem 1rem; 3742 font-size: 23px; 3743 padding: 9px 0 4px 0; 3744 line-height: 1.3; 3745 } 3746 3747 /* Header */ 3748 .privacy-settings-header { 3749 text-align: center; 3750 margin: 0 0 1rem; 3751 background: #fff; 3752 border-bottom: 1px solid #e2e4e7; 3753 } 3754 3755 .privacy-settings-title-section { 3756 display: flex; 3757 align-items: center; 3758 justify-content: center; 3759 clear: both; 3760 } 3761 3762 .privacy-settings-tabs-wrapper { 3763 /* IE 11 */ 3764 display: -ms-inline-grid; 3765 -ms-grid-columns: 1fr 1fr; 3766 vertical-align: top; 3767 /* modern browsers */ 3768 display: inline-grid; 3769 grid-template-columns: 1fr 1fr; 3770 } 3771 3772 .privacy-settings-tab { 3773 display: block; /* IE 11 */ 3774 text-decoration: none; 3775 color: inherit; 3776 padding: 0.5rem 1rem 1rem; 3777 margin: 0 1rem; 3778 transition: box-shadow 0.5s ease-in-out; 3779 } 3780 3781 .privacy-settings-tab:nth-child(1) { 3782 -ms-grid-column: 1; /* IE 11 */ 3783 } 3784 3785 .privacy-settings-tab:nth-child(2) { 3786 -ms-grid-column: 2; /* IE 11 */ 3787 } 3788 3789 .privacy-settings-tab:focus { 3790 color: #191e23; 3791 outline: 1px solid #6c7781; 3792 box-shadow: none; 3793 } 3794 3795 .privacy-settings-tab.active { 3796 box-shadow: inset 0 -3px #007cba; 3797 font-weight: 600; 3798 } 3799 3800 /* Body */ 3801 .privacy-settings-body { 3802 max-width: 800px; 3803 margin: 0 auto; 3804 } 3805 3806 .tools-privacy-policy-page th { 3807 min-width: 230px; 3808 } 3809 3810 .hr-separator { 3811 margin-top: 20px; 3812 margin-bottom: 15px; 3813 } 3814 3815 /* Accordions */ 3816 .privacy-settings-accordion { 3817 border: 1px solid #ccd0d4; 3818 } 3819 3820 .privacy-settings-accordion-heading { 3821 margin: 0; 3822 border-top: 1px solid #ccd0d4; 3823 font-size: inherit; 3824 line-height: inherit; 3825 font-weight: 600; 3826 color: inherit; 3827 } 3828 3829 .privacy-settings-accordion-heading:first-child { 3830 border-top: none; 3831 } 3832 3833 .privacy-settings-accordion-trigger { 3834 background: #fff; 3835 border: 0; 3836 color: #32373c; 3837 cursor: pointer; 3838 display: flex; 3839 font-weight: 400; 3840 margin: 0; 3841 padding: 1em 3.5em 1em 1.5em; 3842 min-height: 46px; 3843 position: relative; 3844 text-align: left; 3845 width: 100%; 3846 align-items: center; 3847 justify-content: space-between; 3848 } 3849 3850 .privacy-settings-accordion-trigger:hover, 3851 .privacy-settings-accordion-trigger:active { 3852 background: #f8f9f9; 3853 } 3854 3855 .privacy-settings-accordion-trigger:focus { 3856 color: #191e23; 3857 border: none; 3858 box-shadow: none; 3859 outline-offset: -1px; 3860 outline: 2px solid #0071a1; 3861 background-color: #f8f9f9; 3862 } 3863 3864 .privacy-settings-accordion-trigger .title { 3865 pointer-events: none; 3866 font-weight: 600; 3867 flex-grow: 1; 3868 } 3869 3870 .privacy-settings-accordion-trigger .icon, 3871 .privacy-settings-view-read .icon { 3872 border: solid #555d66; 3873 border-width: 0 2px 2px 0; 3874 height: 0.5rem; 3875 pointer-events: none; 3876 position: absolute; 3877 right: 1.5em; 3878 top: 50%; 3879 transform: translateY(-70%) rotate(45deg); 3880 width: 0.5rem; 3881 } 3882 3883 .privacy-settings-accordion-trigger .badge { 3884 padding: 0.1rem 0.5rem 0.15rem; 3885 color: #32373c; 3886 font-weight: 600; 3887 margin-left: 0.5rem; 3888 } 3889 3890 .privacy-settings-accordion-trigger .badge.blue { 3891 border: 1px solid #bfe7f3; 3892 } 3893 3894 .privacy-settings-accordion-trigger .badge.orange { 3895 border: 1px solid #ffb900; 3896 } 3897 3898 .privacy-settings-accordion-trigger .badge.red { 3899 border: 1px solid #dc3232; 3900 } 3901 3902 .privacy-settings-accordion-trigger .badge.green { 3903 border: 1px solid #46b450; 3904 } 3905 3906 .privacy-settings-accordion-trigger .badge.purple { 3907 border: 1px solid #826eb4; 3908 } 3909 3910 .privacy-settings-accordion-trigger .badge.gray { 3911 border: 1px solid #ccd0d4; 3912 } 3913 3914 .privacy-settings-accordion-trigger[aria-expanded="true"] .icon, 3915 .privacy-settings-view-passed[aria-expanded="true"] .icon { 3916 transform: translateY(-30%) rotate(-135deg) 3917 } 3918 3919 .privacy-settings-accordion-panel { 3920 margin: 0; 3921 padding: 1em 1.5em; 3922 background: #fff; 3923 } 3924 3925 .privacy-settings-accordion-panel[hidden] { 3926 display: none; 3927 } 3928 3929 .privacy-settings-accordion-panel a .dashicons { 3930 text-decoration: none; 3931 } 3932 3933 .privacy-settings-accordion-actions { 3934 text-align: right; 3935 display: block; 3936 } 3937 3938 .privacy-settings-accordion-actions .success { 3939 display: none; 3940 color: #40860a; 3941 padding-right: 1em; 3942 padding-top: 6px; 3943 } 3944 3945 .privacy-settings-accordion-actions .success.visible { 3946 display: inline-block; 3947 } 3948 3949 /* Suggested text for privacy policy */ 3950 .privacy-settings-accordion-panel.copy-suggested-text > * { 3951 display: none; 3952 } 3953 3954 .privacy-settings-accordion-panel.copy-suggested-text .privacy-policy-suggested-text, 3955 .privacy-settings-accordion-panel.copy-suggested-text .privacy-policy-suggested-text > * { 3956 display: block; 3957 } 3958 3959 .privacy-settings-accordion-panel .privacy-policy-suggested-text-header { 3960 font-weight: 600; 3961 margin-bottom: 10px; 3962 } 3963 3964 .privacy-settings-accordion-panel .privacy-policy-suggested-text { 3965 margin: 0; 3966 padding: 10px; 3967 border-left: 2px solid gray; 3968 } 3969 3970 3971 /* Media queries */ 3972 @media screen and (max-width: 782px) { 3973 3974 .privacy-settings-body { 3975 margin: 0 12px; 3976 width: auto; 3977 } 3978 3979 .privacy-settings .notice { 3980 margin: 5px 10px 15px; 3981 } 3982 3983 .privacy-settings .update-nag { 3984 margin-right: 10px; 3985 margin-left: 10px; 3986 } 3987 3988 input#create-page { 3989 margin-top: 10px; 3990 } 3991 } 3992 3993 @media only screen and (max-width: 1004px) { 3994 3995 .privacy-settings-body { 3996 margin: 0 22px; 3997 width: auto; 3998 } 3999 } 4000 4001 /** 4002 * End Privacy Settings section 4003 */ 4004 3728 4005 /* =Media Queries 3729 4006 -------------------------------------------------------------- */ 3730 4007 -
src/wp-admin/css/edit.css
695 695 min-height: 1.6923em; 696 696 } 697 697 698 /* Suggested text for privacy policy */699 .wp-privacy-policy-guide {700 max-width: 1000px;701 }702 703 .privacy-text-box {704 width: calc(100% - 260px);705 }706 707 .privacy-text-box-toc {708 float: right;709 width: 250px;710 background-color: #fff;711 }712 713 .privacy-text-box-toc p {714 margin: 0;715 padding: 0.7em 1em;716 border-bottom: 1px solid #eee;717 }718 719 .privacy-text-box-toc ol {720 margin-left: 2em;721 }722 723 .wp-privacy-policy-guide h3 {724 font-size: 1.2em;725 margin: 1em 0 0.5em;726 }727 728 .privacy-text-section .privacy-text-copy {729 float: right;730 }731 732 .privacy-text-section {733 position: relative;734 border-top: 1px solid #e3e3e3;735 }736 737 .privacy-text-box-head,738 .privacy-text-section.text-removed {739 padding-bottom: 12px;740 }741 742 .text-removed .policy-text {743 color: #666;744 font-weight: 300;745 padding-left: 1em;746 border-left: 3px solid #ffb900;747 }748 749 .text-removed .policy-text h1,750 .text-removed .policy-text h2,751 .text-removed .policy-text h3,752 .text-removed .policy-text h4,753 .text-removed .policy-text h5,754 .text-removed .policy-text h6 {755 color: #39424a;756 font-weight: 500;757 }758 759 .privacy-text-actions {760 display: inline-block;761 width: 100%;762 height: 32px;763 line-height: 2.46153846;764 padding-bottom: 6px;765 }766 767 .privacy-text-actions .success {768 display: none;769 color: #40860a;770 float: right;771 padding-right: 1em;772 }773 774 .privacy-text-actions .success.visible {775 display: inline-block;776 height: 32px;777 }778 779 .wp-privacy-policy-guide .policy-text h2 {780 margin: 1.2em 0 1em;781 padding: 0;782 }783 784 .suggested-policy-content {785 font-style: italic;786 }787 788 .privacy-text-section .return-to-top {789 float: right;790 margin-right: -250px;791 margin-top: 6px;792 }793 794 #wpbody:target:before {795 content: "";796 display: block;797 padding-top: 50px;798 margin-top: -50px;799 }800 801 .hide-privacy-policy-tutorial {802 background-color: #fff;803 }804 805 .hide-privacy-policy-tutorial .wp-policy-help, /* For back-compat, see #49282 */806 .hide-privacy-policy-tutorial .privacy-policy-tutorial {807 display: none;808 }809 810 .policy-text {811 margin-bottom: 1em;812 }813 814 .policy-text > *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(div):not(.privacy-policy-tutorial):not(.wp-policy-help),815 .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) {816 background-color: #fff;817 margin: 0;818 padding: 1em;819 }820 821 .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),822 .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) {823 padding-top: 0;824 }825 826 .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) {827 margin: 1em 0;828 padding: 0;829 }830 831 .policy-text ul li,832 .policy-text ol li {833 margin-left: 2em;834 }835 836 .policy-text ul {837 list-style: disc;838 }839 840 strong.wp-policy-help, /* For back-compat, see #49282 */841 strong.privacy-policy-tutorial {842 display: block;843 margin: 0 0 1em;844 }845 846 .notice.wp-pp-notice {847 margin: 15px 0 3px;848 }849 850 698 /*------------------------------------------------------------------------------ 851 699 11.1 - Custom Fields 852 700 ------------------------------------------------------------------------------*/ -
src/wp-admin/includes/class-wp-privacy-policy-content.php
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( 'privacy-policy-guide.php?tab=policyguide' ) ) 146 146 ); 147 147 ?> 148 148 </p> … … 328 328 } 329 329 330 330 $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.' ); 331 $url = esc_url( admin_url( ' privacy-policy-guide.php' ) );331 $url = esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); 332 332 $label = __( 'View Privacy Policy Guide.' ); 333 333 334 334 if ( get_current_screen()->is_block_editor() ) { … … 375 375 376 376 $content_array = self::get_suggested_policy_text(); 377 377 $content = ''; 378 $toc = array( '<li><a href="#wp-privacy-policy-guide-introduction">' . __( 'Introduction' ) . '</a></li>' );379 378 $date_format = __( 'F j, Y' ); 380 379 381 380 foreach ( $content_array as $section ) { … … 384 383 $removed = ''; 385 384 386 385 if ( ! empty( $section['removed'] ) ) { 387 $ class = 'text-removed';386 $badge_class = ' red'; 388 387 $date = date_i18n( $date_format, $section['removed'] ); 389 388 /* translators: %s: Date of plugin deactivation. */ 390 $ meta= sprintf( __( 'Removed %s.' ), $date );389 $badge_title = sprintf( __( 'Removed %s.' ), $date ); 391 390 392 391 /* translators: %s: Date of plugin deactivation. */ 393 392 $removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' ); 394 393 $removed = '<div class="notice notice-info inline"><p>' . sprintf( $removed, $date ) . '</p></div>'; 395 394 } elseif ( ! empty( $section['updated'] ) ) { 396 $ class = 'text-updated';395 $badge_class = ' blue'; 397 396 $date = date_i18n( $date_format, $section['updated'] ); 398 397 /* translators: %s: Date of privacy policy text update. */ 399 $ meta= sprintf( __( 'Updated %s.' ), $date );398 $badge_title = sprintf( __( 'Updated %s.' ), $date ); 400 399 } 401 400 402 if ( $meta ) {403 $meta = '<br><span class="privacy-text-meta">' . $meta . '</span>';404 }405 406 401 $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 402 410 $content .= '<div class="privacy-text-section ' . $class . '">'; 411 $content .= '<a id="' . $toc_id . '"> </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 418 if ( empty( $section['removed'] ) ) { 419 $content .= '<div class="privacy-text-actions">'; 420 $content .= '<button type="button" class="privacy-text-copy button">'; 421 $content .= __( 'Copy this section to clipboard' ); 422 $content .= '</button>'; 423 $content .= '<span class="success" aria-hidden="true">' . __( 'Copied!' ) . '</span>'; 424 $content .= '</div>'; 425 } 426 427 $content .= '<a href="#wpbody" class="return-to-top"><span aria-hidden="true">↑ </span> ' . __( 'Go to top' ) . '</a>'; 428 429 $content .= '</div>'; // End of .privacy-text-section. 430 } 431 432 if ( count( $toc ) > 2 ) { 403 $sanitized_policy_name = sanitize_title_with_dashes( $plugin_name ); 433 404 ?> 434 <div class="privacy-text-box-toc"> 435 <p><?php _e( 'Table of Contents' ); ?></p> 436 <ol> 437 <?php echo implode( $toc ); ?> 438 </ol> 405 <h4 class="privacy-settings-accordion-heading"> 406 <button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" type="button"> 407 <span class="title"><?php echo $plugin_name ?></span> 408 <?php if ( ! empty( $section['removed'] ) || ! empty( $section['updated'] ) ) : ?> 409 <span class="badge <?php echo $badge_class; ?>"> <?php echo $badge_title ?></span> 410 <?php endif; ?> 411 <span class="icon"></span> 412 </button> 413 </h4> 414 <div id="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" class="privacy-settings-accordion-panel privacy-text-box-body" hidden="hidden"> 415 <?php 416 echo $removed; 417 echo $section['policy_text']; 418 ?> 419 <?php if ( empty( $section['removed'] ) ) : ?> 420 <div class="privacy-settings-accordion-actions"> 421 <span class="success" aria-hidden="true"><?php _e( 'Copied!' ) ?></span> 422 <button type="button" class="privacy-text-copy button"> 423 <?php _e( 'Copy suggested policy text to clipboard' ); ?> 424 <span class="screen-reader-text"> 425 <?php 426 /* translators: %s: Plugin name. */ 427 sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name ); 428 ?> 429 </span> 430 </button> 431 </div> 432 <?php endif; ?> 439 433 </div> 440 434 <?php 441 435 } 442 443 ?>444 <div class="privacy-text-box">445 <div class="privacy-text-box-head">446 <a id="wp-privacy-policy-guide-introduction"> </a>447 <h2><?php _e( 'Introduction' ); ?></h2>448 <p><?php _e( 'Hello,' ); ?></p>449 <p><?php _e( 'This text template will help you to create your web site’s privacy policy.' ); ?></p>450 <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>451 <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>452 <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>453 </div>454 455 <div class="privacy-text-box-body">456 <?php echo $content; ?>457 </div>458 </div>459 <?php460 436 } 461 437 462 438 /** … … 470 446 * @return string The default policy content. 471 447 */ 472 448 public static function get_default_content( $description = false, $blocks = true ) { 473 $suggested_text = $description ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : '';449 $suggested_text = '<p class="privacy-policy-suggested-text-header">' . __( 'Suggested text:' ) . ' </p>'; 474 450 $content = ''; 475 451 $strings = array(); 476 452 477 453 // Start of the suggested privacy policy text. 478 if ( $description ) {479 $strings[] = '<div class="wp-suggested-text">';480 }481 454 482 455 /* translators: Default privacy policy heading. */ 483 456 $strings[] = '<h2>' . __( 'Who we are' ) . '</h2>'; … … 487 460 $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>'; 488 461 /* translators: Privacy policy tutorial. */ 489 462 $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>'; 463 } else { 464 $strings[] = $suggested_text; 465 /* translators: Default privacy policy text. %s: Site URL. */ 466 $strings[] = '<p class="privacy-policy-suggested-text">' . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>'; 490 467 } 491 468 492 /* translators: Default privacy policy text. %s: Site URL. */493 $strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';494 495 /* translators: Default privacy policy heading. */496 $strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';497 498 469 if ( $description ) { 470 /* translators: Default privacy policy heading. */ 471 $strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>'; 499 472 /* translators: Privacy policy tutorial. */ 500 473 $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>'; 501 474 /* translators: Privacy policy tutorial. */ … … 509 482 } 510 483 511 484 /* translators: Default privacy policy heading. */ 512 $strings[] = '<h 3>' . __( 'Comments' ) . '</h3>';485 $strings[] = '<h2>' . __( 'Comments' ) . '</h2>'; 513 486 514 487 if ( $description ) { 515 488 /* translators: Privacy policy tutorial. */ 516 489 $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>'; 490 } else { 491 $strings[] = $suggested_text; 492 /* translators: Default privacy policy text. */ 493 $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’s IP address and browser user agent string to help spam detection.' ) . '</p>'; 494 /* translators: Default privacy policy text. */ 495 $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>'; 517 496 } 518 519 /* translators: Default privacy policy text. */520 $strings[] = '<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection.' ) . '</p>';521 /* translators: Default privacy policy text. */522 $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>';523 524 497 /* translators: Default privacy policy heading. */ 525 $strings[] = '<h 3>' . __( 'Media' ) . '</h3>';498 $strings[] = '<h2>' . __( 'Media' ) . '</h2>'; 526 499 527 500 if ( $description ) { 528 501 /* translators: Privacy policy tutorial. */ 529 502 $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>'; 503 } else { 504 $strings[] = $suggested_text; 505 /* translators: Default privacy policy text. */ 506 $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>'; 530 507 } 531 508 532 /* translators: Default privacy policy text. */533 $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>';534 535 /* translators: Default privacy policy heading. */536 $strings[] = '<h3>' . __( 'Contact forms' ) . '</h3>';537 538 509 if ( $description ) { 510 /* translators: Default privacy policy heading. */ 511 $strings[] = '<h2>' . __( 'Contact forms' ) . '</h2>'; 539 512 /* translators: Privacy policy tutorial. */ 540 513 $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>'; 541 514 } 542 515 543 516 /* translators: Default privacy policy heading. */ 544 $strings[] = '<h 3>' . __( 'Cookies' ) . '</h3>';517 $strings[] = '<h2>' . __( 'Cookies' ) . '</h2>'; 545 518 546 519 if ( $description ) { 547 520 /* translators: Privacy policy tutorial. */ 548 521 $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>'; 522 } else { 523 $strings[] = $suggested_text; 524 /* translators: Default privacy policy text. */ 525 $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>'; 526 /* translators: Default privacy policy text. */ 527 $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>'; 528 /* translators: Default privacy policy text. */ 529 $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 "Remember Me", your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>'; 530 /* translators: Default privacy policy text. */ 531 $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>'; 549 532 } 533 if ( ! $description ) { 534 /* translators: Default privacy policy heading. */ 535 $strings[] = '<h2>' . __( 'Embedded content from other websites' ) . '</h2>'; 536 $strings[] = $suggested_text; 537 /* translators: Default privacy policy text. */ 538 $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>'; 539 /* translators: Default privacy policy text. */ 540 $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>'; 541 } 550 542 551 /* translators: Default privacy policy text. */552 $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>';553 /* translators: Default privacy policy text. */554 $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>';555 /* translators: Default privacy policy text. */556 $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 "Remember Me", your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>';557 /* translators: Default privacy policy text. */558 $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>';559 560 /* translators: Default privacy policy heading. */561 $strings[] = '<h3>' . __( 'Embedded content from other websites' ) . '</h3>';562 /* translators: Default privacy policy text. */563 $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>';564 /* translators: Default privacy policy text. */565 $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>';566 567 /* translators: Default privacy policy heading. */568 $strings[] = '<h3>' . __( 'Analytics' ) . '</h3>';569 570 543 if ( $description ) { 544 /* translators: Default privacy policy heading. */ 545 $strings[] = '<h2>' . __( 'Analytics' ) . '</h2>'; 571 546 /* translators: Privacy policy tutorial. */ 572 547 $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’s privacy policy, if any.' ) . '</p>'; 573 548 /* translators: Privacy policy tutorial. */ … … 582 557 $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>'; 583 558 /* translators: Privacy policy tutorial. */ 584 559 $strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>'; 560 } else { 561 /* translators: Default privacy policy text. */ 562 $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'If you request a password reset, your IP address will be included in the reset email.' ) . '</p>'; 585 563 } 586 564 587 /* translators: Default privacy policy text. */588 $strings[] = '<p>' . $suggested_text . __( 'If you request a password reset, your IP address will be included in the reset email.' ) . '</p>';589 590 565 /* translators: Default privacy policy heading. */ 591 566 $strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>'; 592 567 … … 593 568 if ( $description ) { 594 569 /* translators: Privacy policy tutorial. */ 595 570 $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>'; 571 } else { 572 $strings[] = $suggested_text; 573 /* translators: Default privacy policy text. */ 574 $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>'; 575 /* translators: Default privacy policy text. */ 576 $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>'; 596 577 } 597 578 598 /* translators: Default privacy policy text. */599 $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>';600 /* translators: Default privacy policy text. */601 $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>';602 603 579 /* translators: Default privacy policy heading. */ 604 580 $strings[] = '<h2>' . __( 'What rights you have over your data' ) . '</h2>'; 605 581 … … 606 582 if ( $description ) { 607 583 /* translators: Privacy policy tutorial. */ 608 584 $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>'; 585 } else { 586 $strings[] = $suggested_text; 587 /* translators: Default privacy policy text. */ 588 $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>'; 609 589 } 610 590 611 /* translators: Default privacy policy text. */612 $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>';613 614 591 /* translators: Default privacy policy heading. */ 615 592 $strings[] = '<h2>' . __( 'Where we send your data' ) . '</h2>'; 616 593 … … 619 596 $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>'; 620 597 /* translators: Privacy policy tutorial. */ 621 598 $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>'; 599 } else { 600 $strings[] = $suggested_text; 601 /* translators: Default privacy policy text. */ 602 $strings[] = '<p class="privacy-policy-suggested-text">' . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>'; 622 603 } 623 604 624 /* translators: Default privacy policy text. */625 $strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';626 627 /* translators: Default privacy policy heading. */628 $strings[] = '<h2>' . __( 'Contact information' ) . '</h2>';629 630 605 if ( $description ) { 606 /* translators: Default privacy policy heading. */ 607 $strings[] = '<h2>' . __( 'Contact information' ) . '</h2>'; 631 608 /* translators: Privacy policy tutorial. */ 632 609 $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>'; 633 610 } 634 611 635 /* translators: Default privacy policy heading. */636 $strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';637 638 612 if ( $description ) { 613 /* translators: Default privacy policy heading. */ 614 $strings[] = '<h2>' . __( 'Additional information' ) . '</h2>'; 639 615 /* translators: Privacy policy tutorial. */ 640 616 $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>'; 641 617 } 642 618 643 /* translators: Default privacy policy heading. */644 $strings[] = '<h3>' . __( 'How we protect your data' ) . '</h3>';645 646 619 if ( $description ) { 620 /* translators: Default privacy policy heading. */ 621 $strings[] = '<h2>' . __( 'How we protect your data' ) . '</h2>'; 647 622 /* translators: Privacy policy tutorial. */ 648 623 $strings[] = '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users’ 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>'; 649 624 } 650 625 651 /* translators: Default privacy policy heading. */652 $strings[] = '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';653 654 626 if ( $description ) { 627 /* translators: Default privacy policy heading. */ 628 $strings[] = '<h2>' . __( 'What data breach procedures we have in place' ) . '</h2>'; 655 629 /* translators: Privacy policy tutorial. */ 656 630 $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>'; 657 631 } 658 632 659 /* translators: Default privacy policy heading. */660 $strings[] = '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';661 662 633 if ( $description ) { 634 /* translators: Default privacy policy heading. */ 635 $strings[] = '<h2>' . __( 'What third parties we receive data from' ) . '</h2>'; 663 636 /* translators: Privacy policy tutorial. */ 664 637 $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>'; 665 638 } 666 639 667 /* translators: Default privacy policy heading. */668 $strings[] = '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';669 670 640 if ( $description ) { 641 /* translators: Default privacy policy heading. */ 642 $strings[] = '<h2>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h2>'; 671 643 /* translators: Privacy policy tutorial. */ 672 644 $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>'; 673 645 } 674 646 675 /* translators: Default privacy policy heading. */676 $strings[] = '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';677 678 647 if ( $description ) { 648 /* translators: Default privacy policy heading. */ 649 $strings[] = '<h2>' . __( 'Industry regulatory disclosure requirements' ) . '</h2>'; 679 650 /* translators: Privacy policy tutorial. */ 680 651 $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>'; 681 $strings[] = '</div>';682 652 } 683 653 684 654 if ( $blocks ) { … … 690 660 if ( 0 === strpos( $string, '<h2>' ) ) { 691 661 $strings[ $key ] = '<!-- wp:heading -->' . $string . '<!-- /wp:heading -->'; 692 662 } 693 694 if ( 0 === strpos( $string, '<h3>' ) ) {695 $strings[ $key ] = '<!-- wp:heading {"level":3} -->' . $string . '<!-- /wp:heading -->';696 }697 663 } 698 664 } 699 665 … … 706 672 * @since 4.9.6 707 673 * @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters. 708 674 * 675 ** @deprecated 5.7.0 This filter has been deprecated. 676 * 709 677 * @param string $content The default policy content. 710 678 * @param string[] $strings An array of privacy policy content strings. 711 679 * @param bool $description Whether policy descriptions should be included. 712 680 * @param bool $blocks Whether the content should be formatted for the block editor. 713 681 */ 714 return apply_filters ( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks);682 return apply_filters_deprecated( 'wp_get_default_privacy_policy_content', array( $content, $strings, $description, $blocks ), '5.4.0', false ); 715 683 } 716 684 717 685 /** … … 720 688 * @since 4.9.6 721 689 */ 722 690 public static function add_suggested_content() { 723 $content = self::get_default_content( true, false );691 $content = self::get_default_content( false, false ); 724 692 wp_add_privacy_policy_content( __( 'WordPress' ), $content ); 725 693 } 726 694 } -
src/wp-admin/options-privacy.php
13 13 wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) ); 14 14 } 15 15 16 if ( isset( $_GET['tab'] ) && 'policyguide' === $_GET['tab'] ) { 17 require_once( dirname( __FILE__ ) . '/privacy-policy-guide.php' ); 18 return; 19 } 20 21 add_filter( 22 'admin_body_class', 23 function( $body_class ) { 24 $body_class .= ' privacy-settings '; 25 26 return $body_class; 27 } 28 ); 29 16 30 $action = isset( $_POST['action'] ) ? $_POST['action'] : ''; 17 31 18 32 if ( ! empty( $action ) ) { … … 112 126 } 113 127 } 114 128 115 $title = __( 'Privacy Settings' );116 129 $parent_file = 'options-general.php'; 117 130 131 wp_enqueue_script( 'privacy-tools' ); 132 118 133 require_once ABSPATH . 'wp-admin/admin-header.php'; 119 134 120 135 ?> 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> 124 168 <p> 125 169 <?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 170 <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?> … … 133 177 <?php _e( 'After your Privacy Policy page is set, we suggest that you edit it.' ); ?> 134 178 <?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 179 </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 180 <p> 172 181 <?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 $view_href = get_permalink( $privacy_policy_page_id ); 191 ?> 192 <strong> 193 <?php 194 if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) { 195 printf( 196 /* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page. */ 197 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ), 198 esc_url( $edit_href ), 199 esc_url( $view_href ) 200 ); 201 } else { 202 printf( 203 /* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page. */ 204 __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ), 205 esc_url( $edit_href ), 206 esc_url( $view_href ) 207 ); 208 } 209 ?> 210 </strong> 211 <?php 212 } 173 213 printf( 174 214 /* 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' ) ),215 __( '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.' ), 216 esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ), 177 217 '', 178 218 '' 179 219 ); … … 181 221 </p> 182 222 183 223 <hr> 224 225 <?php 226 $has_pages = (bool) get_posts( 227 array( 228 'post_type' => 'page', 229 'posts_per_page' => 1, 230 'post_status' => array( 231 'publish', 232 'draft', 233 ), 234 ) 235 ); 236 ?> 237 184 238 <table class="form-table tools-privacy-policy-page" role="presentation"> 185 239 <tr> 186 240 <th scope="row"> 241 <label for="create-page"> 242 <?php 243 if ( $has_pages ) { 244 _e( 'Create a new Privacy Policy Page' ); 245 } else { 246 _e( 'There are no pages.' ); 247 } 248 ?> 249 </label> 250 </td> 251 <td> 252 <form class="wp-create-privacy-page" method="post" action=""> 253 <input type="hidden" name="action" value="create-privacy-page" /> 254 <?php 255 wp_nonce_field( 'create-privacy-page' ); 256 submit_button( __( 'Create' ), 'secondary', 'submit', false, array( 'id' => 'create-page' ) ); 257 ?> 258 </form> 259 </td> 260 </tr> 261 <?php if ( $has_pages ) : ?> 262 <tr> 263 <th scope="row"> 187 264 <label for="page_for_privacy_policy"> 188 265 <?php 189 266 if ( $privacy_policy_page_exists ) { … … 195 272 </label> 196 273 </th> 197 274 <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 ); 275 <form method="post" action=""> 276 <input type="hidden" name="action" value="set-privacy-page" /> 277 <?php 278 wp_dropdown_pages( 279 array( 280 'name' => 'page_for_privacy_policy', 281 'show_option_none' => __( '— Select —' ), 282 'option_none_value' => '0', 283 'selected' => $privacy_policy_page_id, 284 'post_status' => array( 'draft', 'publish' ), 285 ) 286 ); 209 287 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 ); 288 wp_nonce_field( 'set-privacy-page' ); 224 289 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> 243 <?php 244 wp_nonce_field( 'create-privacy-page' ); 245 246 submit_button( __( 'Create New Page' ), 'primary', 'submit', false, array( 'id' => 'create-page' ) ); 290 submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) ); 247 291 ?> 248 292 </form> 249 293 </td> 250 294 </tr> 295 <?php endif; ?> 251 296 </table> 252 297 </div> 253 298 <?php -
src/wp-admin/privacy-policy-guide.php
17 17 include_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php'; 18 18 } 19 19 20 $title = __( 'Privacy Policy Guide' ); 20 add_filter( 21 'admin_body_class', 22 function( $body_class ) { 23 $body_class .= ' privacy-settings '; 21 24 25 return $body_class; 26 } 27 ); 28 22 29 wp_enqueue_script( 'privacy-tools' ); 23 30 24 31 require_once ABSPATH . 'wp-admin/admin-header.php'; 25 32 26 33 ?> 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> 29 40 30 <div class="wp-privacy-policy-guide"> 41 <nav class="privacy-settings-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>"> 42 <a href="<?php echo esc_url( admin_url( 'options-privacy.php' ) ); ?>" class="privacy-settings-tab"> 43 <?php 44 /* translators: Tab heading for Site Health Status page. */ 45 _ex( 'Settings', 'Privacy Settings' ); 46 ?> 47 </a> 48 49 <a href="<?php echo esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); ?>" class="privacy-settings-tab active" aria-current="true"> 50 <?php 51 /* translators: Tab heading for Site Health Status page. */ 52 _ex( 'Policy Guide', 'Privacy Settings' ); 53 ?> 54 </a> 55 </nav> 56 </div> 57 58 <hr class="wp-header-end"> 59 60 <div class="notice notice-error hide-if-js"> 61 <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p> 62 </div> 63 64 <div class="privacy-settings-body hide-if-no-js"> 65 <h2><?php _e( 'Privacy Policy Guide' ); ?></h2> 66 <h3 class="section-title"><?php _e( 'Introduction' ); ?></h3> 67 <p><?php _e( 'This text template will help you to create your web site’s privacy policy.' ); ?></p> 68 <p><?php _e( 'We have suggested the sections you will need. Under each section heading you will find a short summary of what information you should provide, which will help you to get started. Some sections include suggested policy content, others will have to be completed with information from your theme and plugins.' ); ?></p> 69 <p><?php _e( 'Please edit your privacy policy content, making sure to delete the summaries, and adding any information from your theme and plugins. Once you publish your policy page, remember to add it to your navigation menu.' ); ?></p> 70 <p><?php _e( 'It is your responsibility to write a comprehensive privacy policy, to make sure it reflects all national and international legal requirements on privacy, and to keep your policy current and accurate.' ); ?></p> 71 <div class="privacy-settings-accordion"> 72 <h4 class="privacy-settings-accordion-heading"> 73 <button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-privacy-policy-guide" type="button"> 74 <span class="title"><?php _e( 'Privacy Policy Guide' ); ?></span> 75 <span class="icon"></span> 76 </button> 77 </h4> 78 <div id="privacy-settings-accordion-block-privacy-policy-guide" class="privacy-settings-accordion-panel" hidden="hidden"> 79 <?php 80 $content = WP_Privacy_Policy_Content::get_default_content( true, false ); 81 echo $content; 82 ?> 83 </div> 84 </div> 85 <hr class="hr-separator"> 86 <h3 class="section-title"><?php _e( 'Policies' ); ?></h3> 87 <div class="privacy-settings-accordion wp-privacy-policy-guide"> 31 88 <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?> 32 89 </div> 33 </div> 90 </div> <!-- privacy-settings-body --> 34 91 <?php 35 92 36 93 require_once ABSPATH . 'wp-admin/admin-footer.php'; -
src/wp-admin/tools.php
21 21 // The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php. 22 22 if ( isset( $_GET['wp-privacy-policy-guide'] ) ) { 23 23 require_once dirname( __DIR__ ) . '/wp-load.php'; 24 wp_redirect( admin_url( ' privacy-policy-guide.php' ), 301 );24 wp_redirect( admin_url( 'options-privacy.php?tab=policyguide' ), 301 ); 25 25 exit; 26 26 } elseif ( isset( $_GET['page'] ) ) { 27 27 // These were also moved to files in WP 5.3.