Make WordPress Core


Ignore:
Timestamp:
02/07/2024 10:54:34 AM (11 months ago)
Author:
youknowriad
Message:

Editor: Update PHPDoc for block bindings's context arg.

The context argument passed to the hooked_block_types filter can also be a Post object
in the case of the navigation block.
This adapts the PHPDoc accordingly.

Props bernhard-reiter, gziolo.
See #59743.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r57521 r57550  
    824824     * @since 6.4.0
    825825     *
    826      * @param string[]                $hooked_block_types The list of hooked block types.
    827      * @param string                  $relative_position  The relative position of the hooked blocks.
    828      *                                                    Can be one of 'before', 'after', 'first_child', or 'last_child'.
    829      * @param string                  $anchor_block_type  The anchor block type.
    830      * @param WP_Block_Template|array $context            The block template, template part, or pattern that the anchor block belongs to.
     826     * @param string[]                        $hooked_block_types The list of hooked block types.
     827     * @param string                          $relative_position  The relative position of the hooked blocks.
     828     *                                                            Can be one of 'before', 'after', 'first_child', or 'last_child'.
     829     * @param string                          $anchor_block_type  The anchor block type.
     830     * @param WP_Block_Template|WP_Post|array $context            The block template, template part, `wp_navigation` post type,
     831     *                                                            or pattern that the anchor block belongs to.
    831832     */
    832833    $hooked_block_types = apply_filters( 'hooked_block_types', $hooked_block_types, $relative_position, $anchor_block_type, $context );
     
    848849         * @since 6.5.0
    849850         *
    850          * @param array                   $parsed_hooked_block The parsed block array for the given hooked block type.
    851          * @param string                  $relative_position   The relative position of the hooked block.
    852          * @param array                   $parsed_anchor_block The anchor block, in parsed block array format.
    853          * @param WP_Block_Template|array $context             The block template, template part, or pattern that the anchor block belongs to.
     851         * @param array                           $parsed_hooked_block The parsed block array for the given hooked block type.
     852         * @param string                          $relative_position   The relative position of the hooked block.
     853         * @param array                           $parsed_anchor_block The anchor block, in parsed block array format.
     854         * @param WP_Block_Template|WP_Post|array $context             The block template, template part, `wp_navigation` post type,
     855         *                                                             or pattern that the anchor block belongs to.
    854856         */
    855857        $parsed_hooked_block = apply_filters( "hooked_block_{$hooked_block_type}", $parsed_hooked_block, $relative_position, $parsed_anchor_block, $context );
     
    875877 * @access private
    876878 *
    877  * @param array                   $hooked_blocks An array of blocks hooked to another given block.
    878  * @param WP_Block_Template|array $context       A block template, template part, or pattern that the blocks belong to.
     879 * @param array                           $hooked_blocks An array of blocks hooked to another given block.
     880 * @param WP_Block_Template|WP_Post|array $context       A block template, template part, `wp_navigation` post object,
     881 *                                                       or pattern that the blocks belong to.
    879882 * @return callable A function that returns the serialized markup for the given block,
    880883 *                  including the markup for any hooked blocks before it.
     
    921924 * @access private
    922925 *
    923  * @param array                   $hooked_blocks An array of blocks hooked to another block.
    924  * @param WP_Block_Template|array $context       A block template, template part, or pattern that the blocks belong to.
     926 * @param array                           $hooked_blocks An array of blocks hooked to another block.
     927 * @param WP_Block_Template|WP_Post|array $context       A block template, template part, `wp_navigation` post object,
     928 *                                                       or pattern that the blocks belong to.
    925929 * @return callable A function that returns the serialized markup for the given block,
    926930 *                  including the markup for any hooked blocks after it.
Note: See TracChangeset for help on using the changeset viewer.