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.


git-svn-id: https://develop.svn.wordpress.org/trunk@51207 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Felix Arntz 2021-06-22 21:22:27 +00:00
parent 7311d4eb59
commit 41c6786952
2 changed files with 3 additions and 0 deletions

View File

@ -215,6 +215,7 @@ add_filter( 'widget_text_content', 'wp_replace_insecure_home_url' );
add_filter( 'widget_text_content', 'do_shortcode', 11 ); // Runs after wpautop(); note that $post global will be null when shortcodes run.
add_filter( 'widget_block_content', 'do_blocks', 9 );
add_filter( 'widget_block_content', 'wp_filter_content_tags' );
add_filter( 'widget_block_content', 'do_shortcode', 11 );
add_filter( 'block_type_metadata', 'wp_migrate_old_typography_shape' );

View File

@ -3022,6 +3022,7 @@ EOF;
/**
* @ticket 50425
* @ticket 53463
* @dataProvider data_wp_lazy_loading_enabled_context_defaults
*
* @param string $context Function context.
@ -3041,6 +3042,7 @@ EOF;
'the_content => true' => array( 'the_content', true ),
'the_excerpt => true' => array( 'the_excerpt', true ),
'widget_text_content => true' => array( 'widget_text_content', true ),
'widget_block_content => true' => array( 'widget_block_content', true ),
'get_avatar => true' => array( 'get_avatar', true ),
'arbitrary context => true' => array( 'something_completely_arbitrary', true ),
);