WordPress.org

Make WordPress Core

Changeset 51207


Ignore:
Timestamp:
06/22/2021 09:22:27 PM (5 weeks ago)
Author:
flixos90
Message:

Media: Add lazy-loading support to block-based widgets.

This changeset adds the wp_filter_content_tags() function as a filter to widget_block_content.

Props spacedmonkey, walbo, daisyo.
Fixes #53463, #53464.

Location:
trunk
Files:
2 edited

Legend:

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

    r51199 r51207  
    216216
    217217add_filter( 'widget_block_content', 'do_blocks', 9 );
     218add_filter( 'widget_block_content', 'wp_filter_content_tags' );
    218219add_filter( 'widget_block_content', 'do_shortcode', 11 );
    219220
  • trunk/tests/phpunit/tests/media.php

    r50682 r51207  
    30233023    /**
    30243024     * @ticket 50425
     3025     * @ticket 53463
    30253026     * @dataProvider data_wp_lazy_loading_enabled_context_defaults
    30263027     *
     
    30423043            'the_excerpt => true'             => array( 'the_excerpt', true ),
    30433044            'widget_text_content => true'     => array( 'widget_text_content', true ),
     3045            'widget_block_content => true'    => array( 'widget_block_content', true ),
    30443046            'get_avatar => true'              => array( 'get_avatar', true ),
    30453047            'arbitrary context => true'       => array( 'something_completely_arbitrary', true ),
Note: See TracChangeset for help on using the changeset viewer.