Make WordPress Core

Ticket #50146: 50146.2.diff

File 50146.2.diff, 3.9 KB (added by dlh, 5 years ago)
  • src/wp-includes/blocks.php

    diff --git src/wp-includes/blocks.php src/wp-includes/blocks.php
    index 422b75e945..c2cf8b6232 100644
    function get_comment_delimited_block_content( $block_name = null, $block_attribu 
    220220 *
    221221 * @since 5.3.1
    222222 *
    223  * @param WP_Block_Parser_Block $block A single parsed block object.
     223 * @param array $block A single parsed block object.
    224224 * @return string String of rendered HTML.
    225225 */
    226226function serialize_block( $block ) {
    function serialize_block( $block ) { 
    248248 *
    249249 * @since 5.3.1
    250250 *
    251  * @param WP_Block_Parser_Block[] $blocks Parsed block objects.
     251 * @param array[] $blocks Parsed block objects.
    252252 * @return string String of rendered HTML.
    253253 */
    254254function serialize_blocks( $blocks ) {
    function filter_block_content( $text, $allowed_html = 'post', $allowed_protocols 
    286286 *
    287287 * @since 5.3.1
    288288 *
    289  * @param WP_Block_Parser_Block $block             The parsed block object.
    290  * @param array[]|string        $allowed_html      An array of allowed HTML
     289 * @param array          $block                    The parsed block object.
     290 * @param array[]|string $allowed_html             An array of allowed HTML
    291291 *                                                 elements and attributes, or a
    292292 *                                                 context name such as 'post'.
    293  * @param string[]              $allowed_protocols Allowed URL protocols.
     293 * @param string[]       $allowed_protocols        Allowed URL protocols.
    294294 * @return array The filtered and sanitized block object result.
    295295 */
    296296function filter_block_kses( $block, $allowed_html, $allowed_protocols = array() ) {
  • src/wp-includes/class-wp-block-parser.php

    diff --git src/wp-includes/class-wp-block-parser.php src/wp-includes/class-wp-block-parser.php
    index eb4c21a973..9dc15c234f 100644
    class WP_Block_Parser_Block { 
    3838         * List of inner blocks (of this same class)
    3939         *
    4040         * @since 3.8.0
    41          * @var WP_Block_Parser_Block[]
     41         * @var array[]
    4242         */
    4343        public $innerBlocks;
    4444
    class WP_Block_Parser_Frame { 
    102102         * Full or partial block
    103103         *
    104104         * @since 3.8.0
    105          * @var WP_Block_Parser_Block
     105         * @var WP_Block_Parser_Block|array
    106106         */
    107107        public $block;
    108108
    class WP_Block_Parser_Frame { 
    146146         *
    147147         * @since 3.8.0
    148148         *
    149          * @param WP_Block_Parser_Block $block              Full or partial block.
    150          * @param int                   $token_start        Byte offset into document for start of parse token.
    151          * @param int                   $token_length       Byte length of entire parse token string.
    152          * @param int                   $prev_offset        Byte offset into document for after parse token ends.
    153          * @param int                   $leading_html_start Byte offset into document where leading HTML before token starts.
     149         * @param WP_Block_Parser_Block|array $block              Full or partial block.
     150         * @param int                         $token_start        Byte offset into document for start of parse token.
     151         * @param int                         $token_length       Byte length of entire parse token string.
     152         * @param int                         $prev_offset        Byte offset into document for after parse token ends.
     153         * @param int                         $leading_html_start Byte offset into document where leading HTML before token starts.
    154154         */
    155155        function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) {
    156156                $this->block              = $block;
    class WP_Block_Parser { 
    192192         * List of parsed blocks
    193193         *
    194194         * @since 3.8.0
    195          * @var WP_Block_Parser_Block[]
     195         * @var array[]
    196196         */
    197197        public $output;
    198198
    class WP_Block_Parser { 
    222222         * @since 3.8.0
    223223         *
    224224         * @param string $document Input document being parsed.
    225          * @return WP_Block_Parser_Block[]
     225         * @return array[]
    226226         */
    227227        function parse( $document ) {
    228228                $this->document    = $document;