@@ 156-163 (lines=8) @@ | ||
153 | return false; |
|
154 | } |
|
155 | ||
156 | function remove_embed() { |
|
157 | global $wp_embed; |
|
158 | remove_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
|
159 | // remove the embed shortcode since we would do the part later. |
|
160 | remove_shortcode( 'embed' ); |
|
161 | // Attempts to embed all URLs in a post |
|
162 | remove_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
|
163 | } |
|
164 | ||
165 | function add_embed() { |
|
166 | global $wp_embed; |
|
@@ 165-172 (lines=8) @@ | ||
162 | remove_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
|
163 | } |
|
164 | ||
165 | function add_embed() { |
|
166 | global $wp_embed; |
|
167 | add_filter( 'the_content', array( $wp_embed, 'run_shortcode' ), 8 ); |
|
168 | // Shortcode placeholder for strip_shortcodes() |
|
169 | add_shortcode( 'embed', '__return_false' ); |
|
170 | // Attempts to embed all URLs in a post |
|
171 | add_filter( 'the_content', array( $wp_embed, 'autoembed' ), 8 ); |
|
172 | } |
|
173 | ||
174 | // Expands wp_insert_post to include filtered content |
|
175 | function filter_post_content_and_add_links( $post_object ) { |