wp/wp-admin/includes/class-wp-privacy-policy-content.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    85 
    85 
    86 		$new = self::$policy_content;
    86 		$new = self::$policy_content;
    87 
    87 
    88 		// Remove the extra values added to the meta.
    88 		// Remove the extra values added to the meta.
    89 		foreach ( $old as $key => $data ) {
    89 		foreach ( $old as $key => $data ) {
    90 			if ( ! empty( $data['removed'] ) ) {
    90 			if ( ! is_array( $data ) || ! empty( $data['removed'] ) ) {
    91 				unset( $old[ $key ] );
    91 				unset( $old[ $key ] );
    92 				continue;
    92 				continue;
    93 			}
    93 			}
    94 
    94 
    95 			$old[ $key ] = array(
    95 			$old[ $key ] = array(
   140 			<p>
   140 			<p>
   141 			<?php
   141 			<?php
   142 				printf(
   142 				printf(
   143 					/* translators: %s: Privacy Policy Guide URL. */
   143 					/* translators: %s: Privacy Policy Guide URL. */
   144 					__( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
   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 			</p>
   148 			</p>
   149 		</div>
   149 		</div>
   150 		<?php
   150 		<?php
   326 		if ( 'post' !== $current_screen->base || $policy_page_id !== $post->ID ) {
   326 		if ( 'post' !== $current_screen->base || $policy_page_id !== $post->ID ) {
   327 			return;
   327 			return;
   328 		}
   328 		}
   329 
   329 
   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.' );
   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 		$label   = __( 'View Privacy Policy Guide.' );
   332 		$label   = __( 'View Privacy Policy Guide.' );
   333 
   333 
   334 		if ( get_current_screen()->is_block_editor() ) {
   334 		if ( get_current_screen()->is_block_editor() ) {
   335 			wp_enqueue_script( 'wp-notices' );
   335 			wp_enqueue_script( 'wp-notices' );
   336 			$action = array(
   336 			$action = array(
   373 	 */
   373 	 */
   374 	public static function privacy_policy_guide() {
   374 	public static function privacy_policy_guide() {
   375 
   375 
   376 		$content_array = self::get_suggested_policy_text();
   376 		$content_array = self::get_suggested_policy_text();
   377 		$content       = '';
   377 		$content       = '';
   378 		$toc           = array( '<li><a href="#wp-privacy-policy-guide-introduction">' . __( 'Introduction' ) . '</a></li>' );
       
   379 		$date_format   = __( 'F j, Y' );
   378 		$date_format   = __( 'F j, Y' );
   380 
   379 
   381 		foreach ( $content_array as $section ) {
   380 		foreach ( $content_array as $section ) {
   382 			$class   = '';
   381 			$class   = '';
   383 			$meta    = '';
   382 			$meta    = '';
   384 			$removed = '';
   383 			$removed = '';
   385 
   384 
   386 			if ( ! empty( $section['removed'] ) ) {
   385 			if ( ! empty( $section['removed'] ) ) {
   387 				$class = 'text-removed';
   386 				$badge_class = ' red';
   388 				$date  = date_i18n( $date_format, $section['removed'] );
   387 				$date        = date_i18n( $date_format, $section['removed'] );
   389 				/* translators: %s: Date of plugin deactivation. */
   388 				/* translators: %s: Date of plugin deactivation. */
   390 				$meta = sprintf( __( 'Removed %s.' ), $date );
   389 				$badge_title = sprintf( __( 'Removed %s.' ), $date );
   391 
   390 
   392 				/* translators: %s: Date of plugin deactivation. */
   391 				/* translators: %s: Date of plugin deactivation. */
   393 				$removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
   392 				$removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
   394 				$removed = '<div class="notice notice-info inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
   393 				$removed = '<div class="notice notice-info inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
   395 			} elseif ( ! empty( $section['updated'] ) ) {
   394 			} elseif ( ! empty( $section['updated'] ) ) {
   396 				$class = 'text-updated';
   395 				$badge_class = ' blue';
   397 				$date  = date_i18n( $date_format, $section['updated'] );
   396 				$date        = date_i18n( $date_format, $section['updated'] );
   398 				/* translators: %s: Date of privacy policy text update. */
   397 				/* translators: %s: Date of privacy policy text update. */
   399 				$meta = sprintf( __( 'Updated %s.' ), $date );
   398 				$badge_title = sprintf( __( 'Updated %s.' ), $date );
   400 			}
       
   401 
       
   402 			if ( $meta ) {
       
   403 				$meta = '<br><span class="privacy-text-meta">' . $meta . '</span>';
       
   404 			}
   399 			}
   405 
   400 
   406 			$plugin_name = esc_html( $section['plugin_name'] );
   401 			$plugin_name = esc_html( $section['plugin_name'] );
   407 			$toc_id      = 'wp-privacy-policy-guide-' . sanitize_title( $plugin_name );
   402 
   408 			$toc[]       = sprintf( '<li><a href="#%1$s">%2$s</a>' . $meta . '</li>', $toc_id, $plugin_name );
   403 			$sanitized_policy_name = sanitize_title_with_dashes( $plugin_name );
   409 
       
   410 			$content .= '<div class="privacy-text-section ' . $class . '">';
       
   411 			$content .= '<a id="' . $toc_id . '">&nbsp;</a>';
       
   412 			/* translators: %s: Plugin name. */
       
   413 			$content .= '<h2>' . sprintf( __( 'Source: %s' ), $plugin_name ) . '</h2>';
       
   414 			$content .= $removed;
       
   415 
       
   416 			$content .= '<div class="policy-text">' . $section['policy_text'] . '</div>';
       
   417 
       
   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">&uarr; </span> ' . __( 'Return to top' ) . '</a>';
       
   428 
       
   429 			$content .= '</div>'; // End of .privacy-text-section.
       
   430 		}
       
   431 
       
   432 		if ( count( $toc ) > 2 ) {
       
   433 			?>
   404 			?>
   434 			<div class="privacy-text-box-toc">
   405 			<h4 class="privacy-settings-accordion-heading">
   435 				<p><?php _e( 'Table of Contents' ); ?></p>
   406 			<button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" type="button">
   436 				<ol>
   407 				<span class="title"><?php echo $plugin_name; ?></span>
   437 					<?php echo implode( $toc ); ?>
   408 				<?php if ( ! empty( $section['removed'] ) || ! empty( $section['updated'] ) ) : ?>
   438 				</ol>
   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 						<span aria-hidden="true"><?php _e( 'Copy suggested policy text to clipboard' ); ?></span>
       
   424 						<span class="screen-reader-text">
       
   425 							<?php
       
   426 							/* translators: %s: Plugin name. */
       
   427 							printf( __( 'Copy suggested policy text from %s.' ), $plugin_name );
       
   428 							?>
       
   429 						</span>
       
   430 					</button>
       
   431 				</div>
       
   432 				<?php endif; ?>
   439 			</div>
   433 			</div>
   440 			<?php
   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">&nbsp;</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&#8217;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 		<?php
       
   460 	}
   436 	}
   461 
   437 
   462 	/**
   438 	/**
   463 	 * Return the default suggested privacy policy content.
   439 	 * Return the default suggested privacy policy content.
   464 	 *
   440 	 *
   468 	 * @param bool $description Whether to include the descriptions under the section headings. Default false.
   444 	 * @param bool $description Whether to include the descriptions under the section headings. Default false.
   469 	 * @param bool $blocks      Whether to format the content for the block editor. Default true.
   445 	 * @param bool $blocks      Whether to format the content for the block editor. Default true.
   470 	 * @return string The default policy content.
   446 	 * @return string The default policy content.
   471 	 */
   447 	 */
   472 	public static function get_default_content( $description = false, $blocks = true ) {
   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 = '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>';
   474 		$content        = '';
   450 		$content        = '';
   475 		$strings        = array();
   451 		$strings        = array();
   476 
   452 
   477 		// Start of the suggested privacy policy text.
   453 		// Start of the suggested privacy policy text.
   478 		if ( $description ) {
   454 		if ( $description ) {
   485 		if ( $description ) {
   461 		if ( $description ) {
   486 			/* translators: Privacy policy tutorial. */
   462 			/* translators: Privacy policy tutorial. */
   487 			$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>';
   463 			$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 			/* translators: Privacy policy tutorial. */
   464 			/* translators: Privacy policy tutorial. */
   489 			$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>';
   465 			$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>';
   490 		}
   466 		} else {
   491 
   467 			/* translators: Default privacy policy text. %s: Site URL. */
   492 		/* translators: Default privacy policy text. %s: Site URL. */
   468 			$strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';
   493 		$strings[] = '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>';
   469 		}
   494 
   470 
   495 		/* translators: Default privacy policy heading. */
   471 		if ( $description ) {
   496 		$strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
   472 			/* translators: Default privacy policy heading. */
   497 
   473 			$strings[] = '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
   498 		if ( $description ) {
       
   499 			/* translators: Privacy policy tutorial. */
   474 			/* translators: Privacy policy tutorial. */
   500 			$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>';
   475 			$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 			/* translators: Privacy policy tutorial. */
   476 			/* translators: Privacy policy tutorial. */
   502 			$strings[] = '<p class="privacy-policy-tutorial">' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>';
   477 			$strings[] = '<p class="privacy-policy-tutorial">' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>';
   503 			/* translators: Privacy policy tutorial. */
   478 			/* translators: Privacy policy tutorial. */
   507 			/* translators: Privacy policy tutorial. */
   482 			/* translators: Privacy policy tutorial. */
   508 			$strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>';
   483 			$strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>';
   509 		}
   484 		}
   510 
   485 
   511 		/* translators: Default privacy policy heading. */
   486 		/* translators: Default privacy policy heading. */
   512 		$strings[] = '<h3>' . __( 'Comments' ) . '</h3>';
   487 		$strings[] = '<h2>' . __( 'Comments' ) . '</h2>';
   513 
   488 
   514 		if ( $description ) {
   489 		if ( $description ) {
   515 			/* translators: Privacy policy tutorial. */
   490 			/* translators: Privacy policy tutorial. */
   516 			$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>';
   491 			$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>';
   517 		}
   492 		} else {
   518 
   493 			/* translators: Default privacy policy text. */
   519 		/* translators: Default privacy policy text. */
   494 			$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>';
   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&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>';
   495 			/* translators: Default privacy policy text. */
   521 		/* translators: Default privacy policy text. */
   496 			$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>';
   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>';
   497 		}
   523 
   498 
   524 		/* translators: Default privacy policy heading. */
   499 		/* translators: Default privacy policy heading. */
   525 		$strings[] = '<h3>' . __( 'Media' ) . '</h3>';
   500 		$strings[] = '<h2>' . __( 'Media' ) . '</h2>';
   526 
   501 
   527 		if ( $description ) {
   502 		if ( $description ) {
   528 			/* translators: Privacy policy tutorial. */
   503 			/* translators: Privacy policy tutorial. */
   529 			$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>';
   504 			$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>';
   530 		}
   505 		} else {
   531 
   506 			/* translators: Default privacy policy text. */
   532 		/* translators: Default privacy policy text. */
   507 			$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>';
   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>';
   508 		}
   534 
   509 
   535 		/* translators: Default privacy policy heading. */
   510 		if ( $description ) {
   536 		$strings[] = '<h3>' . __( 'Contact forms' ) . '</h3>';
   511 			/* translators: Default privacy policy heading. */
   537 
   512 			$strings[] = '<h2>' . __( 'Contact forms' ) . '</h2>';
   538 		if ( $description ) {
       
   539 			/* translators: Privacy policy tutorial. */
   513 			/* translators: Privacy policy tutorial. */
   540 			$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>';
   514 			$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 		}
   515 		}
   542 
   516 
   543 		/* translators: Default privacy policy heading. */
   517 		/* translators: Default privacy policy heading. */
   544 		$strings[] = '<h3>' . __( 'Cookies' ) . '</h3>';
   518 		$strings[] = '<h2>' . __( 'Cookies' ) . '</h2>';
   545 
   519 
   546 		if ( $description ) {
   520 		if ( $description ) {
   547 			/* translators: Privacy policy tutorial. */
   521 			/* translators: Privacy policy tutorial. */
   548 			$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 			$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>';
   549 		}
   523 		} else {
   550 
   524 			/* translators: Default privacy policy text. */
   551 		/* translators: Default privacy policy text. */
   525 			$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>';
   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>';
   526 			/* translators: Default privacy policy text. */
   553 		/* translators: Default privacy policy text. */
   527 			$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>';
   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>';
   528 			/* translators: Default privacy policy text. */
   555 		/* translators: Default privacy policy text. */
   529 			$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>';
   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 &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>';
   530 			/* translators: Default privacy policy text. */
   557 		/* translators: Default privacy policy text. */
   531 			$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>';
   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>';
   532 		}
   559 
   533 
   560 		/* translators: Default privacy policy heading. */
   534 		if ( ! $description ) {
   561 		$strings[] = '<h3>' . __( 'Embedded content from other websites' ) . '</h3>';
   535 			/* translators: Default privacy policy heading. */
   562 		/* translators: Default privacy policy text. */
   536 			$strings[] = '<h2>' . __( 'Embedded content from other websites' ) . '</h2>';
   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>';
   537 			/* translators: Default privacy policy text. */
   564 		/* translators: Default privacy policy text. */
   538 			$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>';
   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>';
   539 			/* translators: Default privacy policy text. */
   566 
   540 			$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>';
   567 		/* translators: Default privacy policy heading. */
   541 		}
   568 		$strings[] = '<h3>' . __( 'Analytics' ) . '</h3>';
   542 
   569 
   543 		if ( $description ) {
   570 		if ( $description ) {
   544 			/* translators: Default privacy policy heading. */
       
   545 			$strings[] = '<h2>' . __( 'Analytics' ) . '</h2>';
   571 			/* translators: Privacy policy tutorial. */
   546 			/* translators: Privacy policy tutorial. */
   572 			$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>';
   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&#8217;s privacy policy, if any.' ) . '</p>';
   573 			/* translators: Privacy policy tutorial. */
   548 			/* translators: Privacy policy tutorial. */
   574 			$strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';
   549 			$strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';
   575 		}
   550 		}
   580 		if ( $description ) {
   555 		if ( $description ) {
   581 			/* translators: Privacy policy tutorial. */
   556 			/* translators: Privacy policy tutorial. */
   582 			$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>';
   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 			/* translators: Privacy policy tutorial. */
   558 			/* translators: Privacy policy tutorial. */
   584 			$strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';
   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>' . $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 heading. */
   565 		/* translators: Default privacy policy heading. */
   588 		$strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>';
   566 		$strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>';
   589 
   567 
   590 		if ( $description ) {
   568 		if ( $description ) {
   591 			/* translators: Privacy policy tutorial. */
   569 			/* translators: Privacy policy tutorial. */
   592 			$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>';
   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>';
   593 		}
   571 		} else {
   594 
   572 			/* translators: Default privacy policy text. */
   595 		/* translators: Default privacy policy text. */
   573 			$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>';
   596 		$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>';
   574 			/* translators: Default privacy policy text. */
   597 		/* translators: Default privacy policy text. */
   575 			$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>';
   598 		$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>';
   576 		}
   599 
   577 
   600 		/* translators: Default privacy policy heading. */
   578 		/* translators: Default privacy policy heading. */
   601 		$strings[] = '<h2>' . __( 'What rights you have over your data' ) . '</h2>';
   579 		$strings[] = '<h2>' . __( 'What rights you have over your data' ) . '</h2>';
   602 
   580 
   603 		if ( $description ) {
   581 		if ( $description ) {
   604 			/* translators: Privacy policy tutorial. */
   582 			/* translators: Privacy policy tutorial. */
   605 			$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>';
   583 			$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>';
   606 		}
   584 		} else {
   607 
   585 			/* translators: Default privacy policy text. */
   608 		/* translators: Default privacy policy text. */
   586 			$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>';
   609 		$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>';
   587 		}
   610 
   588 
   611 		/* translators: Default privacy policy heading. */
   589 		/* translators: Default privacy policy heading. */
   612 		$strings[] = '<h2>' . __( 'Where we send your data' ) . '</h2>';
   590 		$strings[] = '<h2>' . __( 'Where we send your data' ) . '</h2>';
   613 
   591 
   614 		if ( $description ) {
   592 		if ( $description ) {
   615 			/* translators: Privacy policy tutorial. */
   593 			/* translators: Privacy policy tutorial. */
   616 			$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>';
   594 			$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>';
   617 			/* translators: Privacy policy tutorial. */
   595 			/* translators: Privacy policy tutorial. */
   618 			$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>';
   596 			$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>';
   619 		}
   597 		} else {
   620 
   598 			/* translators: Default privacy policy text. */
   621 		/* translators: Default privacy policy text. */
   599 			$strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
   622 		$strings[] = '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
   600 		}
   623 
   601 
   624 		/* translators: Default privacy policy heading. */
   602 		if ( $description ) {
   625 		$strings[] = '<h2>' . __( 'Your contact information' ) . '</h2>';
   603 			/* translators: Default privacy policy heading. */
   626 
   604 			$strings[] = '<h2>' . __( 'Contact information' ) . '</h2>';
   627 		if ( $description ) {
       
   628 			/* translators: Privacy policy tutorial. */
   605 			/* translators: Privacy policy tutorial. */
   629 			$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>';
   606 			$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>';
   630 		}
   607 		}
   631 
   608 
   632 		/* translators: Default privacy policy heading. */
   609 		if ( $description ) {
   633 		$strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';
   610 			/* translators: Default privacy policy heading. */
   634 
   611 			$strings[] = '<h2>' . __( 'Additional information' ) . '</h2>';
   635 		if ( $description ) {
       
   636 			/* translators: Privacy policy tutorial. */
   612 			/* translators: Privacy policy tutorial. */
   637 			$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>';
   613 			$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>';
   638 		}
   614 		}
   639 
   615 
   640 		/* translators: Default privacy policy heading. */
   616 		if ( $description ) {
   641 		$strings[] = '<h3>' . __( 'How we protect your data' ) . '</h3>';
   617 			/* translators: Default privacy policy heading. */
   642 
   618 			$strings[] = '<h2>' . __( 'How we protect your data' ) . '</h2>';
   643 		if ( $description ) {
       
   644 			/* translators: Privacy policy tutorial. */
   619 			/* translators: Privacy policy tutorial. */
   645 			$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>';
   620 			$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>';
   646 		}
   621 		}
   647 
   622 
   648 		/* translators: Default privacy policy heading. */
   623 		if ( $description ) {
   649 		$strings[] = '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
   624 			/* translators: Default privacy policy heading. */
   650 
   625 			$strings[] = '<h2>' . __( 'What data breach procedures we have in place' ) . '</h2>';
   651 		if ( $description ) {
       
   652 			/* translators: Privacy policy tutorial. */
   626 			/* translators: Privacy policy tutorial. */
   653 			$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>';
   627 			$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>';
   654 		}
   628 		}
   655 
   629 
   656 		/* translators: Default privacy policy heading. */
   630 		if ( $description ) {
   657 		$strings[] = '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
   631 			/* translators: Default privacy policy heading. */
   658 
   632 			$strings[] = '<h2>' . __( 'What third parties we receive data from' ) . '</h2>';
   659 		if ( $description ) {
       
   660 			/* translators: Privacy policy tutorial. */
   633 			/* translators: Privacy policy tutorial. */
   661 			$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>';
   634 			$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>';
   662 		}
   635 		}
   663 
   636 
   664 		/* translators: Default privacy policy heading. */
   637 		if ( $description ) {
   665 		$strings[] = '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
   638 			/* translators: Default privacy policy heading. */
   666 
   639 			$strings[] = '<h2>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h2>';
   667 		if ( $description ) {
       
   668 			/* translators: Privacy policy tutorial. */
   640 			/* translators: Privacy policy tutorial. */
   669 			$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>';
   641 			$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>';
   670 		}
   642 		}
   671 
   643 
   672 		/* translators: Default privacy policy heading. */
   644 		if ( $description ) {
   673 		$strings[] = '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
   645 			/* translators: Default privacy policy heading. */
   674 
   646 			$strings[] = '<h2>' . __( 'Industry regulatory disclosure requirements' ) . '</h2>';
   675 		if ( $description ) {
       
   676 			/* translators: Privacy policy tutorial. */
   647 			/* translators: Privacy policy tutorial. */
   677 			$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>';
   648 			$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>';
   678 			$strings[] = '</div>';
   649 			$strings[] = '</div>';
   679 		}
   650 		}
   680 
   651 
   685 				}
   656 				}
   686 
   657 
   687 				if ( 0 === strpos( $string, '<h2>' ) ) {
   658 				if ( 0 === strpos( $string, '<h2>' ) ) {
   688 					$strings[ $key ] = '<!-- wp:heading -->' . $string . '<!-- /wp:heading -->';
   659 					$strings[ $key ] = '<!-- wp:heading -->' . $string . '<!-- /wp:heading -->';
   689 				}
   660 				}
   690 
       
   691 				if ( 0 === strpos( $string, '<h3>' ) ) {
       
   692 					$strings[ $key ] = '<!-- wp:heading {"level":3} -->' . $string . '<!-- /wp:heading -->';
       
   693 				}
       
   694 			}
   661 			}
   695 		}
   662 		}
   696 
   663 
   697 		$content = implode( '', $strings );
   664 		$content = implode( '', $strings );
   698 		// End of the suggested privacy policy text.
   665 		// End of the suggested privacy policy text.
   700 		/**
   667 		/**
   701 		 * Filters the default content suggested for inclusion in a privacy policy.
   668 		 * Filters the default content suggested for inclusion in a privacy policy.
   702 		 *
   669 		 *
   703 		 * @since 4.9.6
   670 		 * @since 4.9.6
   704 		 * @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters.
   671 		 * @since 5.0.0 Added the `$strings`, `$description`, and `$blocks` parameters.
       
   672 		 * @deprecated 5.7.0 Use wp_add_privacy_policy_content() instead.
   705 		 *
   673 		 *
   706 		 * @param string   $content     The default policy content.
   674 		 * @param string   $content     The default policy content.
   707 		 * @param string[] $strings     An array of privacy policy content strings.
   675 		 * @param string[] $strings     An array of privacy policy content strings.
   708 		 * @param bool     $description Whether policy descriptions should be included.
   676 		 * @param bool     $description Whether policy descriptions should be included.
   709 		 * @param bool     $blocks      Whether the content should be formatted for the block editor.
   677 		 * @param bool     $blocks      Whether the content should be formatted for the block editor.
   710 		 */
   678 		 */
   711 		return apply_filters( 'wp_get_default_privacy_policy_content', $content, $strings, $description, $blocks );
   679 		return apply_filters_deprecated(
       
   680 			'wp_get_default_privacy_policy_content',
       
   681 			array( $content, $strings, $description, $blocks ),
       
   682 			'5.7.0',
       
   683 			'wp_add_privacy_policy_content()'
       
   684 		);
   712 	}
   685 	}
   713 
   686 
   714 	/**
   687 	/**
   715 	 * Add the suggested privacy policy text to the policy postbox.
   688 	 * Add the suggested privacy policy text to the policy postbox.
   716 	 *
   689 	 *
   717 	 * @since 4.9.6
   690 	 * @since 4.9.6
   718 	 */
   691 	 */
   719 	public static function add_suggested_content() {
   692 	public static function add_suggested_content() {
   720 		$content = self::get_default_content( true, false );
   693 		$content = self::get_default_content( false, false );
   721 		wp_add_privacy_policy_content( __( 'WordPress' ), $content );
   694 		wp_add_privacy_policy_content( __( 'WordPress' ), $content );
   722 	}
   695 	}
   723 }
   696 }