Make WordPress Core

Changeset 45259


Ignore:
Timestamp:
04/23/2019 09:04:19 PM (7 years ago)
Author:
azaozz
Message:

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.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-debug-data.php

    r45246 r45259  
    984984                 * for the copied data.
    985985                 *
     986                 * All strings are expected to be plain text except $description that can contain inline HTML tags (see below).
     987                 *
    986988                 * @since 5.2.0
    987989                 *
     
    995997                 *     @type string  $label        The title for this section of the debug output.
    996998                 *     @type string  $description  Optional. A description for your information section which may contain basic HTML
    997                  *                                 markup: `em`, `strong` and `a` for linking to documentation or putting emphasis.
     999                 *                                 markup, inline tags only as it is outputted in a paragraph.
    9981000                 *     @type boolean $show_count   Optional. If set to `true` the amount of fields will be included in the title for
    9991001                 *                                 this section.
  • trunk/src/wp-admin/site-health-info.php

    r45245 r45259  
    138138                                <?php
    139139
    140                                 $kses_settings = array(
    141                                         'a'      => array(
    142                                                 'href' => true,
    143                                         ),
    144                                         'strong' => true,
    145                                         'em'     => true,
    146                                 );
    147 
    148140                                if ( isset( $details['description'] ) && ! empty( $details['description'] ) ) {
    149                                         printf( '<p>%s</p>', wp_kses( $details['description'], $kses_settings ) );
     141                                        printf( '<p>%s</p>', $details['description'] );
    150142                                }
    151143
Note: See TracChangeset for help on using the changeset viewer.