@@ 333-340 (lines=8) @@ | ||
330 | * |
|
331 | * @global $wp_embed |
|
332 | */ |
|
333 | public function remove_embed() { |
|
334 | global $wp_embed; |
|
335 | remove_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
|
336 | // remove the embed shortcode since we would do the part later. |
|
337 | remove_shortcode( 'embed' ); |
|
338 | // Attempts to embed all URLs in a post. |
|
339 | remove_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
|
340 | } |
|
341 | ||
342 | /** |
|
343 | * Add the embed shortcode. |
|
@@ 347-354 (lines=8) @@ | ||
344 | * |
|
345 | * @global $wp_embed |
|
346 | */ |
|
347 | public function add_embed() { |
|
348 | global $wp_embed; |
|
349 | add_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
|
350 | // Shortcode placeholder for strip_shortcodes(). |
|
351 | add_shortcode( 'embed', '__return_false' ); |
|
352 | // Attempts to embed all URLs in a post. |
|
353 | add_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
|
354 | } |
|
355 | ||
356 | /** |
|
357 | * Expands wp_insert_post to include filtered content |