|
@@ 93-100 (lines=8) @@
|
| 90 |
|
return $args; |
| 91 |
|
} |
| 92 |
|
|
| 93 |
|
function remove_embed() { |
| 94 |
|
global $wp_embed; |
| 95 |
|
remove_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
| 96 |
|
// remove the embed shortcode since we would do the part later. |
| 97 |
|
remove_shortcode( 'embed' ); |
| 98 |
|
// Attempts to embed all URLs in a post |
| 99 |
|
remove_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
function add_embed() { |
| 103 |
|
global $wp_embed; |
|
@@ 102-109 (lines=8) @@
|
| 99 |
|
remove_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
function add_embed() { |
| 103 |
|
global $wp_embed; |
| 104 |
|
add_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
| 105 |
|
// Shortcode placeholder for strip_shortcodes() |
| 106 |
|
add_shortcode( 'embed', '__return_false' ); |
| 107 |
|
// Attempts to embed all URLs in a post |
| 108 |
|
add_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
// Expands wp_insert_post to include filtered content |
| 112 |
|
function filter_post_content_and_add_links( $post_object ) { |