mirror of
git://develop.git.wordpress.org/
synced 2025-03-23 13:29:56 +01:00
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
This commit is contained in:
parent
3fd93789b8
commit
490b4a3a6c
@ -381,7 +381,11 @@ final class WP_Privacy_Policy_Content {
|
||||
$content = '';
|
||||
$date_format = __( 'F j, Y' );
|
||||
|
||||
$i = 0;
|
||||
|
||||
foreach ( $content_array as $section ) {
|
||||
++$i;
|
||||
|
||||
$class = '';
|
||||
$meta = '';
|
||||
$removed = '';
|
||||
@ -409,11 +413,9 @@ final class WP_Privacy_Policy_Content {
|
||||
}
|
||||
|
||||
$plugin_name = esc_html( $section['plugin_name'] );
|
||||
|
||||
$sanitized_policy_name = sanitize_title_with_dashes( $plugin_name );
|
||||
?>
|
||||
<h4 class="privacy-settings-accordion-heading">
|
||||
<button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" type="button">
|
||||
<button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-<?php echo $i; ?>" type="button">
|
||||
<span class="title"><?php echo $plugin_name; ?></span>
|
||||
<?php if ( ! empty( $section['removed'] ) || ! empty( $section['updated'] ) ) : ?>
|
||||
<span class="badge <?php echo $badge_class; ?>"> <?php echo $badge_title; ?></span>
|
||||
@ -421,7 +423,7 @@ final class WP_Privacy_Policy_Content {
|
||||
<span class="icon"></span>
|
||||
</button>
|
||||
</h4>
|
||||
<div id="privacy-settings-accordion-block-<?php echo $sanitized_policy_name; ?>" class="privacy-settings-accordion-panel privacy-text-box-body" hidden="hidden">
|
||||
<div id="privacy-settings-accordion-block-<?php echo $i; ?>" class="privacy-settings-accordion-panel privacy-text-box-body" hidden="hidden">
|
||||
<?php
|
||||
echo $removed;
|
||||
echo $section['policy_text'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user