Site Health: Allow some HTML (inline tags only) in the section descriptions. Add some more docs about expected formatting of the gathered data.

Props kraftbj, jeherve, mukesh27, audrasjb, azaozz.
Fixes #46878.

git-svn-id: https://develop.svn.wordpress.org/trunk@45259 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2019-04-23 21:04:19 +00:00
parent 8756d56b7e
commit 14fc4634a2
2 changed files with 4 additions and 10 deletions

View File

@ -983,6 +983,8 @@ class WP_Debug_Data {
* a prefix, both for consistency as well as avoiding key collisions. Note that the array keys are used as labels
* for the copied data.
*
* All strings are expected to be plain text except $description that can contain inline HTML tags (see below).
*
* @since 5.2.0
*
* @param array $args {
@ -994,7 +996,7 @@ class WP_Debug_Data {
*
* @type string $label The title for this section of the debug output.
* @type string $description Optional. A description for your information section which may contain basic HTML
* markup: `em`, `strong` and `a` for linking to documentation or putting emphasis.
* markup, inline tags only as it is outputted in a paragraph.
* @type boolean $show_count Optional. If set to `true` the amount of fields will be included in the title for
* this section.
* @type boolean $private Optional. If set to `true` the section and all associated fields will be excluded

View File

@ -137,16 +137,8 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<div id="health-check-accordion-block-<?php echo esc_attr( $section ); ?>" class="health-check-accordion-panel" hidden="hidden">
<?php
$kses_settings = array(
'a' => array(
'href' => true,
),
'strong' => true,
'em' => true,
);
if ( isset( $details['description'] ) && ! empty( $details['description'] ) ) {
printf( '<p>%s</p>', wp_kses( $details['description'], $kses_settings ) );
printf( '<p>%s</p>', $details['description'] );
}
?>