Created
October 23, 2018 10:25
-
-
Save jeffreyvr/36af385f0df070674dbc750a8eb77376 to your computer and use it in GitHub Desktop.
Adding oEmbed filter in custom WordPress function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function prefix_get_custom_sidebar() { | |
global $post, $wp_embed; | |
$custom_sidebar = get_post_meta( $post->ID, 'custom_sidebar', true ); | |
$custom_sidebar = $wp_embed->autoembed( $custom_sidebar ); // Apply oEmbed filter | |
return $custom_sidebar; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment