Make WordPress Core

Changeset 52631


Ignore:
Timestamp:
01/24/2022 03:26:56 PM (16 months ago)
Author:
audrasjb
Message:

Docs: Docblock corrections for get_block_file_template().

Follow-up to [52324].

Props johnbillion, SergeyBiryukov, costdev.
Fixes #54879.

File:
1 edited

Legend:

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

    r52610 r52631  
    499499 * @access private
    500500 *
    501  * @param array $template_file Theme file.
    502  * @param array $template_type 'wp_template' or 'wp_template_part'.
     501 * @param array  $template_file Theme file.
     502 * @param string $template_type 'wp_template' or 'wp_template_part'.
    503503 *
    504504 * @return WP_Block_Template Template.
     
    601601 * @since 5.8.0
    602602 *
    603  * @param array $query {
     603 * @param array  $query {
    604604 *     Optional. Arguments to retrieve templates.
    605605 *
     
    609609 *     @type string $post_type Post type to get the templates for.
    610610 * }
    611  * @param array $template_type 'wp_template' or 'wp_template_part'.
     611 * @param string $template_type 'wp_template' or 'wp_template_part'.
    612612 *
    613613 * @return array Templates.
     
    623623     * @param WP_Block_Template[]|null $block_templates Return an array of block templates to short-circuit the default query,
    624624     *                                                  or null to allow WP to run it's normal queries.
    625      * @param array $query {
     625     * @param array  $query {
    626626     *     Optional. Arguments to retrieve templates.
    627627     *
     
    630630     *     @type string $post_type Post type to get the templates for.
    631631     * }
    632      * @param array $template_type wp_template or wp_template_part.
     632     * @param string $template_type wp_template or wp_template_part.
    633633     */
    634634    $templates = apply_filters( 'pre_get_block_templates', null, $query, $template_type );
     
    726726     *
    727727     * @param WP_Block_Template[] $query_result Array of found block templates.
    728      * @param array $query {
     728     * @param array  $query {
    729729     *     Optional. Arguments to retrieve templates.
    730730     *
     
    732732     *     @type int    $wp_id Post ID of customized template.
    733733     * }
    734      * @param array $template_type wp_template or wp_template_part.
     734     * @param string $template_type wp_template or wp_template_part.
    735735     */
    736736    return apply_filters( 'get_block_templates', $query_result, $query, $template_type );
     
    743743 *
    744744 * @param string $id            Template unique identifier (example: theme_slug//template_slug).
    745  * @param array $template_type Optional. Template type: `'wp_template'` or '`wp_template_part'`.
     745 * @param string $template_type Optional. Template type: `'wp_template'` or '`wp_template_part'`.
    746746 *                              Default `'wp_template'`.
    747747 *
     
    759759     *                                               or null to allow WP to run its normal queries.
    760760     * @param string $id                             Template unique identifier (example: theme_slug//template_slug).
    761      * @param array $template_type                  Template type: `'wp_template'` or '`wp_template_part'`.
     761     * @param string $template_type                  Template type: `'wp_template'` or '`wp_template_part'`.
    762762     */
    763763    $block_template = apply_filters( 'pre_get_block_template', null, $id, $template_type );
     
    816816 *
    817817 * @param string $id            Template unique identifier (example: theme_slug//template_slug).
    818  * @param array $template_type Optional. Template type: `'wp_template'` or '`wp_template_part'`.
     818 * @param string $template_type Optional. Template type: `'wp_template'` or '`wp_template_part'`.
    819819 *                              Default `'wp_template'`.
     820 * @return WP_Block_Template|null The found block template, or null if there isn't one.
    820821 */
    821822function get_block_file_template( $id, $template_type = 'wp_template' ) {
     
    825826     * Return a non-null value to bypass the WordPress queries.
    826827     *
    827      *
    828828     * @since 5.9.0
    829829     *
    830830     * @param WP_Block_Template|null $block_template Return block template object to short-circuit the default query,
    831831     *                                               or null to allow WP to run its normal queries.
    832      * @param string $id                             Template unique identifier (example: theme_slug//template_slug).
    833      * @param array  $template_type                  Template type: `'wp_template'` or '`wp_template_part'`.
     832     * @param string                 $id             Template unique identifier (example: theme_slug//template_slug).
     833     * @param string                 $template_type  Template type: `'wp_template'` or '`wp_template_part'`.
    834834     */
    835835    $block_template = apply_filters( 'pre_get_block_file_template', null, $id, $template_type );
     
    840840    $parts = explode( '//', $id, 2 );
    841841    if ( count( $parts ) < 2 ) {
    842         /** This filter is documented at the end of this function */
     842        /** This filter is documented in wp-includes/block-template-utils.php */
    843843        return apply_filters( 'get_block_file_template', null, $id, $template_type );
    844844    }
     
    846846
    847847    if ( wp_get_theme()->get_stylesheet() !== $theme ) {
    848         /** This filter is documented at the end of this function */
     848        /** This filter is documented in wp-includes/block-template-utils.php */
    849849        return apply_filters( 'get_block_file_template', null, $id, $template_type );
    850850    }
     
    852852    $template_file = _get_block_template_file( $template_type, $slug );
    853853    if ( null === $template_file ) {
    854         /** This filter is documented at the end of this function */
     854        /** This filter is documented in wp-includes/block-template-utils.php */
    855855        return apply_filters( 'get_block_file_template', null, $id, $template_type );
    856856    }
     
    863863     * @since 5.9.0
    864864     *
    865      * @param WP_Block_Template $block_template The found block template.
    866      * @param string            $id             Template unique identifier (example: theme_slug//template_slug).
    867      * @param array             $template_type  Template type: `'wp_template'` or '`wp_template_part'`.
     865     * @param WP_Block_Template|null $block_template The found block template, or null if there is none.
     866     * @param string                 $id             Template unique identifier (example: theme_slug//template_slug).
     867     * @param string                 $template_type  Template type: `'wp_template'` or '`wp_template_part'`.
    868868     */
    869869    return apply_filters( 'get_block_file_template', $block_template, $id, $template_type );
Note: See TracChangeset for help on using the changeset viewer.