wordpress snippets last updated   : January 29, 2015
we now have 646 snippets

Enable oEmbed in Text/HTML Widgets

wordpress snippet

Adding this PHP snippet to the functions.php of your wordpress theme will enable oembed for widgets.

snippet :  PHPcopy
add_filter( 'widget_text', array( $wp_embed, 'run_shortcode' ), 8 );
add_filter( 'widget_text', array( $wp_embed, 'autoembed'), 8 );

Did you like this post? If so please share it with your friends. Thanks!