Skip to content

Commit 490b4a3

Browse files
committed
Privacy: Replace Policy Name with an auto increment to avoid internationalized plugin name issues.
This changeset replaces plugin sanitized names with an auto increment integer to fix an issue with accordions displaying privacy policies for plugins with special characters in their names. Follow-up to [50161]. Props ecgan, sabernhardt, audrasjb. Fixes #62713. git-svn-id: https://develop.svn.wordpress.org/trunk@59732 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 3fd9378 commit 490b4a3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/wp-admin/includes/class-wp-privacy-policy-content.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,11 @@ public static function privacy_policy_guide() {
381381
$content = '';
382382
$date_format = __( 'F j, Y' );
383383

384+
$i = 0;
385+
384386
foreach ( $content_array as $section ) {
387+
++$i;
388+
385389
$class = '';
386390
$meta = '';
387391
$removed = '';
@@ -409,19 +413,17 @@ public static function privacy_policy_guide() {
409413
}
410414

411415
$plugin_name = esc_html( $section['plugin_name'] );
412-
413-
$sanitized_policy_name = sanitize_title_with_dashes( $plugin_name );
414416
?>
415417
<h4 class="privacy-settings-accordion-heading">
416-
<button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" type="button">
418+
<button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $i; ?>" type="button">
417419
<span class="title"><?php echo $plugin_name; ?></span>
418420
<?php if ( ! empty( $section['removed'] ) || ! empty( $section['updated'] ) ) : ?>
419421
<span class="badge <?php echo $badge_class; ?>"> <?php echo $badge_title; ?></span>
420422
<?php endif; ?>
421423
<span class="icon"></span>
422424
</button>
423425
</h4>
424-
<div id="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" class="privacy-settings-accordion-panel privacy-text-box-body" hidden="hidden">
426+
<div id="privacy-settings-accordion-block-<?php echo $i; ?>" class="privacy-settings-accordion-panel privacy-text-box-body" hidden="hidden">
425427
<?php
426428
echo $removed;
427429
echo $section['policy_text'];

0 commit comments

Comments
 (0)