WordPress has an auto-embed feature, that automatically embeds a YouTube video, if the url appears on its own line – in any content.
I needed to DISABLE this on my site, and I found a simple “remove_filter” hook (on http://wpengineer.com/2487/disable-oembed-wordpress/ ), which works for WP’s the_content() — but it does NOT work for ACF content.
I tried using the same idea on an ACF hook, but this did not work.
remove_filter( 'acf_the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 );
In the plugin file advanced-custom-fields/core/fields/wysiwyg.php, line #254, i found format_value_for_api()
, which seems to add the standard filters that WP adds to the_content(), including ‘autoembed’, on line #261.
So I’m trying to remove that filter, just as was done for the_content().
Any ideas how to do that, or otherwise disable media auto-embeds in ACF content?