Make WordPress Core


Ignore:
Timestamp:
06/02/2021 01:17:37 AM (3 years ago)
Author:
noisysocks
Message:

Widget block: Add widget_block_content filter

Adds a new 'widget_block_content' filter to the widget block and hooks
run_shortcode, autoembed, do_blocks, and do_shortcode into it by
default. This is simlar to widget_text_content.

Fixes #51566.
Props talldanwp.

File:
1 edited

Legend:

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

    r48586 r51058  
    3232        add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 );
    3333        add_filter( 'widget_text_content', array( $this, 'run_shortcode' ), 8 );
     34        add_filter( 'widget_block_content', array( $this, 'run_shortcode' ), 8 );
    3435
    3536        // Shortcode placeholder for strip_shortcodes().
     
    3940        add_filter( 'the_content', array( $this, 'autoembed' ), 8 );
    4041        add_filter( 'widget_text_content', array( $this, 'autoembed' ), 8 );
     42        add_filter( 'widget_block_content', array( $this, 'autoembed' ), 8 );
    4143
    4244        // After a post is saved, cache oEmbed items via Ajax.
Note: See TracChangeset for help on using the changeset viewer.