From bcf36bdf18c63640b7b03fe31b19bf0246ffe1e5 Mon Sep 17 00:00:00 2001 From: Jordan Schelew Date: Sun, 24 Jan 2016 11:21:33 -0600 Subject: [PATCH 1/3] Add feature: auto-embed of video links Uses WordPress wp_oembed_get function to auto-embed YouTube/Vimeo links etc. --- includes/views/single-listing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/views/single-listing.php b/includes/views/single-listing.php index 6c2ae64..fb69569 100644 --- a/includes/views/single-listing.php +++ b/includes/views/single-listing.php @@ -196,7 +196,7 @@ function single_listing_post_content() { ID, '_listing_video', true) != '') { ?>
- ID, '_listing_video', true); ?> + ID, '_listing_video', true) ); ?>
From fd59cfcf0e7b8a8e1d4ae4c5637a85722490b462 Mon Sep 17 00:00:00 2001 From: Jordan Schelew Date: Sun, 24 Jan 2016 12:01:17 -0600 Subject: [PATCH 2/3] Improvements to auto-embedding videos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simplify code by introducing $video_url variable and updates to support a false return value from wp_oembed_get. Could probably still use better URL detection (such as if the admin enters a URL without the ‘http://' --- includes/views/single-listing.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/views/single-listing.php b/includes/views/single-listing.php index fb69569..199a3e4 100644 --- a/includes/views/single-listing.php +++ b/includes/views/single-listing.php @@ -193,10 +193,14 @@ function single_listing_post_content() { - ID, '_listing_video', true) != '') { ?> + ID, '_listing_video', true) != '') { + $video_url = get_post_meta( $post->ID, '_listing_video', true); + ?>
- ID, '_listing_video', true) ); ?> + $video_url"; } ?>
From eeb32d70b6a03247944a6ec3d5de6dd4c8b4242c Mon Sep 17 00:00:00 2001 From: Jordan Schelew Date: Sat, 26 Jan 2019 23:30:22 -0400 Subject: [PATCH 3/3] Revert video embed code --- includes/views/single-listing.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/includes/views/single-listing.php b/includes/views/single-listing.php index 199a3e4..bd140cd 100644 --- a/includes/views/single-listing.php +++ b/includes/views/single-listing.php @@ -193,14 +193,9 @@ function single_listing_post_content() { - ID, '_listing_video', true) != '') { - $video_url = get_post_meta( $post->ID, '_listing_video', true); - ?>
- $video_url"; } ?> + ID, '_listing_video', true); ?>