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