mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@51058 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -31,6 +31,7 @@ class WP_Embed {
|
||||
// Hack to get the [embed] shortcode to run before wpautop().
|
||||
add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 );
|
||||
add_filter( 'widget_text_content', array( $this, 'run_shortcode' ), 8 );
|
||||
add_filter( 'widget_block_content', array( $this, 'run_shortcode' ), 8 );
|
||||
|
||||
// Shortcode placeholder for strip_shortcodes().
|
||||
add_shortcode( 'embed', '__return_false' );
|
||||
@@ -38,6 +39,7 @@ class WP_Embed {
|
||||
// Attempts to embed all URLs in a post.
|
||||
add_filter( 'the_content', array( $this, 'autoembed' ), 8 );
|
||||
add_filter( 'widget_text_content', array( $this, 'autoembed' ), 8 );
|
||||
add_filter( 'widget_block_content', array( $this, 'autoembed' ), 8 );
|
||||
|
||||
// After a post is saved, cache oEmbed items via Ajax.
|
||||
add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) );
|
||||
|
||||
Reference in New Issue
Block a user