29 */ |
29 */ |
30 public function __construct() { |
30 public function __construct() { |
31 // Hack to get the [embed] shortcode to run before wpautop(). |
31 // Hack to get the [embed] shortcode to run before wpautop(). |
32 add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 ); |
32 add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 ); |
33 add_filter( 'widget_text_content', array( $this, 'run_shortcode' ), 8 ); |
33 add_filter( 'widget_text_content', array( $this, 'run_shortcode' ), 8 ); |
|
34 add_filter( 'widget_block_content', array( $this, 'run_shortcode' ), 8 ); |
34 |
35 |
35 // Shortcode placeholder for strip_shortcodes(). |
36 // Shortcode placeholder for strip_shortcodes(). |
36 add_shortcode( 'embed', '__return_false' ); |
37 add_shortcode( 'embed', '__return_false' ); |
37 |
38 |
38 // Attempts to embed all URLs in a post. |
39 // Attempts to embed all URLs in a post. |
39 add_filter( 'the_content', array( $this, 'autoembed' ), 8 ); |
40 add_filter( 'the_content', array( $this, 'autoembed' ), 8 ); |
40 add_filter( 'widget_text_content', array( $this, 'autoembed' ), 8 ); |
41 add_filter( 'widget_text_content', array( $this, 'autoembed' ), 8 ); |
|
42 add_filter( 'widget_block_content', array( $this, 'autoembed' ), 8 ); |
41 |
43 |
42 // After a post is saved, cache oEmbed items via Ajax. |
44 // After a post is saved, cache oEmbed items via Ajax. |
43 add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) ); |
45 add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) ); |
44 add_action( 'edit_page_form', array( $this, 'maybe_run_ajax_cache' ) ); |
46 add_action( 'edit_page_form', array( $this, 'maybe_run_ajax_cache' ) ); |
45 } |
47 } |