|
@@ 320-327 (lines=8) @@
|
| 317 |
|
* |
| 318 |
|
* @global $wp_embed |
| 319 |
|
*/ |
| 320 |
|
public function remove_embed() { |
| 321 |
|
global $wp_embed; |
| 322 |
|
remove_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
| 323 |
|
// remove the embed shortcode since we would do the part later. |
| 324 |
|
remove_shortcode( 'embed' ); |
| 325 |
|
// Attempts to embed all URLs in a post. |
| 326 |
|
remove_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
| 327 |
|
} |
| 328 |
|
|
| 329 |
|
/** |
| 330 |
|
* Add the embed shortcode. |
|
@@ 334-341 (lines=8) @@
|
| 331 |
|
* |
| 332 |
|
* @global $wp_embed |
| 333 |
|
*/ |
| 334 |
|
public function add_embed() { |
| 335 |
|
global $wp_embed; |
| 336 |
|
add_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
| 337 |
|
// Shortcode placeholder for strip_shortcodes(). |
| 338 |
|
add_shortcode( 'embed', '__return_false' ); |
| 339 |
|
// Attempts to embed all URLs in a post. |
| 340 |
|
add_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
| 341 |
|
} |
| 342 |
|
|
| 343 |
|
/** |
| 344 |
|
* Expands wp_insert_post to include filtered content |