Created
February 6, 2019 01:53
-
-
Save hmbashar/9ce478d61d039a89235dfea73fd26180 to your computer and use it in GitHub Desktop.
Thumbnail Video
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
// Function | |
function cb_get_embedded_media( $type = array() ){ | |
$content = do_shortcode( apply_filters( 'the_content', get_the_content() ) ); | |
$embed = get_media_embedded_in_content( $content, $type ); | |
if( in_array( 'audio' , $type) ): | |
$output = str_replace( '?visual=true', '?visual=false', $embed[0] ); | |
else: | |
$output = $embed[0]; | |
endif; | |
return $output; | |
} |
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
// Call | |
<?php echo cb_get_embedded_media( array('video','iframe') ); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment