Created
June 1, 2020 16:45
-
-
Save wowthemesnet/708aadebbb18fe8abd3c71cf09b0a464 to your computer and use it in GitHub Desktop.
Get Media Embedded in Content WordPress
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 $audio_media = get_media_embedded_in_content( | |
apply_filters( 'the_content', get_the_content() ), array( 'audio') | |
); | |
if ( has_post_format( 'audio' )) { | |
foreach ($audio_media as $audio_med) { | |
echo $audio_med; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment