Make WordPress Core


Ignore:
Timestamp:
05/02/2024 07:52:42 PM (3 years ago)
Author:
johnbillion
Message:

Docs: Document the array shapes for parsed blocks, template part areas, and template types.

See #60699

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-template-utils.php

    r58071 r58084  
    5454 * @since 5.9.0
    5555 *
    56  * @return array[] The supported template part area values.
     56 * @return array[] {
     57 *     The allowed template part area values.
     58 *
     59 *     @type array ...$0 {
     60 *         Data for the allowed template part area.
     61 *
     62 *         @type string $area        Template part area name.
     63 *         @type string $label       Template part area label.
     64 *         @type string $description Template part area description.
     65 *         @type string $icon        Template part area icon.
     66 *         @type string $area_tag    Template part area tag.
     67 *     }
     68 * }
    5769 */
    5870function get_allowed_block_template_part_areas() {
    … …  
    92104         * @since 5.9.0
    93105         *
    94          * @param array[] $default_area_definitions An array of supported area objects.
     106         * @param array[] $default_area_definitions {
     107         *     The allowed template part area values.
     108         *
     109         *     @type array ...$0 {
     110         *         Data for the template part area.
     111         *
     112         *         @type string $area        Template part area name.
     113         *         @type string $label       Template part area label.
     114         *         @type string $description Template part area description.
     115         *         @type string $icon        Template part area icon.
     116         *         @type string $area_tag    Template part area tag.
     117         *     }
     118         * }
    95119         */
    96120        return apply_filters( 'default_wp_template_part_areas', $default_area_definitions );
    … …  
    104128 * @since 5.9.0
    105129 *
    106  * @return array[] The default template types.
     130 * @return array[] {
     131 *     The default template types.
     132 *
     133 *     @type array ...$0 {
     134 *         Data for the template type.
     135 *
     136 *         @type string $title       Template type title.
     137 *         @type string $description Template type description.
     138 *    }
     139 * }
    107140 */
    108141function get_default_block_template_types() {
    … …  
    179212         * @since 5.9.0
    180213         *
    181          * @param array[] $default_template_types An array of template types, formatted as [ slug => [ title, description ] ].
     214         * @param array[] $default_template_types {
     215         *     The default template types.
     216         *
     217         *     @type array ...$0 {
     218         *         Data for the template type.
     219         *
     220         *         @type string $title       Template type title.
     221         *         @type string $description Template type description.
     222         *    }
     223         * }
    182224         */
    183225        return apply_filters( 'default_template_types', $default_template_types );
Note: See TracChangeset for help on using the changeset viewer.