diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/includes/class-wp-privacy-policy-content.php --- a/wp/wp-admin/includes/class-wp-privacy-policy-content.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/includes/class-wp-privacy-policy-content.php Fri Sep 05 18:40:08 2025 +0200 @@ -7,6 +7,7 @@ * @since 4.9.6 */ +#[AllowDynamicProperties] final class WP_Privacy_Policy_Content { private static $policy_content = array(); @@ -19,7 +20,7 @@ private function __construct() {} /** - * Add content to the postbox shown when editing the privacy policy. + * Adds content to the postbox shown when editing the privacy policy. * * Plugins and themes should suggest text for inclusion in the site's privacy policy. * The suggested text should contain information about any functionality that affects user privacy, @@ -48,7 +49,7 @@ } /** - * Quick check if any privacy info has changed. + * Performs a quick check to determine whether any privacy info has changed. * * @since 4.9.6 */ @@ -102,11 +103,15 @@ sort( $old ); sort( $new ); - // The == operator (equal, not identical) was used intentionally. - // See http://php.net/manual/en/language.operators.array.php + /* + * The == operator (equal, not identical) was used intentionally. + * See https://www.php.net/manual/en/language.operators.array.php + */ if ( $new != $old ) { - // A plugin was activated or deactivated, or some policy text has changed. - // Show a notice on the relevant screens to inform the admin. + /* + * A plugin was activated or deactivated, or some policy text has changed. + * Show a notice on the relevant screens to inform the admin. + */ add_action( 'admin_notices', array( 'WP_Privacy_Policy_Content', 'policy_text_changed_notice' ) ); $state = 'changed'; } else { @@ -122,38 +127,35 @@ } /** - * Output a warning when some privacy info has changed. + * Outputs a warning when some privacy info has changed. * * @since 4.9.6 - * - * @global WP_Post $post Global post object. */ public static function policy_text_changed_notice() { - global $post; - $screen = get_current_screen()->id; if ( 'privacy' !== $screen ) { return; } - ?> -
- review the guide and update your privacy policy.' ), - esc_url( admin_url( 'privacy-policy-guide.php?tab=policyguide' ) ) - ); - ?> -
-- %s %s', - $url, - $label, - /* translators: Accessibility text. */ - __( '(opens in a new tab)' ) - ); - ?> -
-' . sprintf( $removed, $date ) . '
' . __( '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.' ) . '
'; + $strings[] = '' . __( 'In this subsection you should list the cookies your website uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '
'; } else { /* translators: Default privacy policy text. */ $strings[] = '' . $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.' ) . '
'; @@ -537,7 +543,7 @@ if ( ! $description ) { /* translators: Default privacy policy heading. */ - $strings[] = '' . $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.' ) . '
'; /* translators: Default privacy policy text. */ @@ -554,7 +560,7 @@ } /* translators: Default privacy policy heading. */ - $strings[] = '' . __( '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.' ) . '
'; + $strings[] = '' . __( 'In this section you should explain how long you retain personal data collected or processed by the website. 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.' ) . '
'; } else { /* translators: Default privacy policy text. */ $strings[] = '' . $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.' ) . '
'; @@ -580,7 +586,7 @@ } /* translators: Default privacy policy heading. */ - $strings[] = '' . __( '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.' ) . '
'; + $strings[] = '' . __( 'If your website 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.' ) . '
'; } if ( $description ) { /* translators: Default privacy policy heading. */ $strings[] = '' . __( '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.' ) . '
'; + $strings[] = '' . __( 'If your website 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.' ) . '
'; } if ( $description ) { @@ -655,12 +661,12 @@ if ( $blocks ) { foreach ( $strings as $key => $string ) { - if ( 0 === strpos( $string, '' ) ) { - $strings[ $key ] = '' . $string . ''; + if ( str_starts_with( $string, '
' ) ) { + $strings[ $key ] = "\n" . $string . "\n\n"; } - if ( 0 === strpos( $string, '