|
@@ 402-409 (lines=8) @@
|
| 399 |
|
* |
| 400 |
|
* @global $wp_embed |
| 401 |
|
*/ |
| 402 |
|
public function remove_embed() { |
| 403 |
|
global $wp_embed; |
| 404 |
|
remove_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
| 405 |
|
// remove the embed shortcode since we would do the part later. |
| 406 |
|
remove_shortcode( 'embed' ); |
| 407 |
|
// Attempts to embed all URLs in a post. |
| 408 |
|
remove_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
| 409 |
|
} |
| 410 |
|
|
| 411 |
|
/** |
| 412 |
|
* Add the embed shortcode. |
|
@@ 416-423 (lines=8) @@
|
| 413 |
|
* |
| 414 |
|
* @global $wp_embed |
| 415 |
|
*/ |
| 416 |
|
public function add_embed() { |
| 417 |
|
global $wp_embed; |
| 418 |
|
add_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
| 419 |
|
// Shortcode placeholder for strip_shortcodes(). |
| 420 |
|
add_shortcode( 'embed', '__return_false' ); |
| 421 |
|
// Attempts to embed all URLs in a post. |
| 422 |
|
add_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
| 423 |
|
} |
| 424 |
|
|
| 425 |
|
/** |
| 426 |
|
* Expands wp_insert_post to include filtered content |