Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement auto-embedding of video URLs [fixed] #83

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions includes/views/single-listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,14 @@ function single_listing_post_content() {
</div><!-- #listing-gallery -->
<?php } ?>

<?php if (get_post_meta( $post->ID, '_listing_video', true) != '') { ?>
<?php if (get_post_meta( $post->ID, '_listing_video', true) != '') {
$video_url = esc_url( get_post_meta( $post->ID, '_listing_video', true), array('http', 'https') );
?>
<div id="listing-video">
<div class="iframe-wrap">
<?php echo get_post_meta( $post->ID, '_listing_video', true); ?>
<?php if (wp_oembed_get( $video_url )){
echo wp_oembed_get( $video_url );
} else { echo "<a href='$video_url'>$video_url</a>"; } ?>
</div>
</div><!-- #listing-video -->
<?php } ?>
Expand Down