Make WordPress Core

Changeset 51949


Ignore:
Timestamp:
10/29/2021 03:33:18 PM (3 years ago)
Author:
johnbillion
Message:

Site Health: Correct and improve the documentation for the debug_information hook.

This corrects the structure of the documentation so it accurately reflects the array elements contained within.

See #53399.

File:
1 edited

Legend:

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

    r51919 r51949  
    14091409
    14101410        /**
    1411          * Add or modify the debug information.
     1411         * Add to or modify the debug information shown on the Tools -> Site Health -> Info screen.
    14121412         *
    14131413         * Plugin or themes may wish to introduce their own debug information without creating additional admin pages
     
    14181418         * for the copied data.
    14191419         *
    1420          * All strings are expected to be plain text except $description that can contain inline HTML tags (see below).
     1420         * All strings are expected to be plain text except `$description` that can contain inline HTML tags (see below).
    14211421         *
    14221422         * @since 5.2.0
     
    14251425         *     The debug information to be added to the core information page.
    14261426         *
    1427          *     This is an associative multi-dimensional array, up to three levels deep. The topmost array holds the sections.
    1428          *     Each section has a `$fields` associative array (see below), and each `$value` in `$fields` can be
    1429          *     another associative array of name/value pairs when there is more structured data to display.
     1427         *     This is an associative multi-dimensional array, up to three levels deep. The topmost array holds the sections, keyed by section ID.
    14301428         *
    1431          *     @type string  $label        The title for this section of the debug output.
    1432          *     @type string  $description  Optional. A description for your information section which may contain basic HTML
    1433          *                                 markup, inline tags only as it is outputted in a paragraph.
    1434          *     @type boolean $show_count   Optional. If set to `true` the amount of fields will be included in the title for
    1435          *                                 this section.
    1436          *     @type boolean $private      Optional. If set to `true` the section and all associated fields will be excluded
    1437          *                                 from the copied data.
    1438          *     @type array   $fields {
    1439          *         An associative array containing the data to be displayed.
     1429         *     @type array ...$0 {
     1430         *         Each section has a `$fields` associative array (see below), and each `$value` in `$fields` can be
     1431         *         another associative array of name/value pairs when there is more structured data to display.
    14401432         *
    1441          *         @type string  $label    The label for this piece of information.
    1442          *         @type string  $value    The output that is displayed for this field. Text should be translated. Can be
    1443          *                                 an associative array that is displayed as name/value pairs.
    1444          *         @type string  $debug    Optional. The output that is used for this field when the user copies the data.
    1445          *                                 It should be more concise and not translated. If not set, the content of `$value` is used.
    1446          *                                 Note that the array keys are used as labels for the copied data.
    1447          *         @type boolean $private  Optional. If set to `true` the field will not be included in the copied data
    1448          *                                 allowing you to show, for example, API keys here.
     1433         *         @type string $label       Required. The title for this section of the debug output.
     1434         *         @type string $description Optional. A description for your information section which may contain basic HTML
     1435         *                                   markup, inline tags only as it is outputted in a paragraph.
     1436         *         @type bool   $show_count  Optional. If set to `true` the amount of fields will be included in the title for
     1437         *                                   this section.
     1438         *         @type bool   $private     Optional. If set to `true` the section and all associated fields will be excluded
     1439         *                                   from the copied data. Default false.
     1440         *         @type array  $fields {
     1441         *             Required. An associative array containing the fields to be displayed in the section, keyed by field ID.
     1442         *
     1443         *             @type array ...$0 {
     1444         *                 An associative array containing the data to be displayed for the field.
     1445         *
     1446         *                 @type string $label    Required. The label for this piece of information.
     1447         *                 @type mixed  $value    Required. The output that is displayed for this field. Text should be translated. Can be
     1448         *                                        an associative array that is displayed as name/value pairs.
     1449         *                                        Accepted types: `string|int|float|(string|int|float)[]`.
     1450         *                 @type string $debug    Optional. The output that is used for this field when the user copies the data.
     1451         *                                        It should be more concise and not translated. If not set, the content of `$value` is used.
     1452         *                                        Note that the array keys are used as labels for the copied data.
     1453         *                 @type bool   $private  Optional. If set to `true` the field will not be included in the copied data
     1454         *                                        allowing you to show, for example, API keys here. Default false.
     1455         *             }
     1456         *         }
    14491457         *     }
    14501458         * }
Note: See TracChangeset for help on using the changeset viewer.