You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: automatic-featured-images-from-videos.php
+51-36Lines changed: 51 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
<?php
2
2
/*
3
3
* Plugin Name: Automatic Featured Images from YouTube / Vimeo
4
-
* Plugin URI: http://webdevstudios.com
4
+
* Plugin URI: https://webdevstudios.com
5
5
* Description: If a YouTube or Vimeo video exists in the first few paragraphs of a post, automatically set the post's featured image to that video's thumbnail.
6
-
* Version: 1.1.2
6
+
* Version: 1.2.0
7
7
* Author: WebDevStudios
8
-
* Author URI: http://webdevstudios.com
8
+
* Author URI: https://webdevstudios.com
9
9
* License: GPLv2
10
10
* Text Domain: automatic-featured-images-from-videos
_doing_it_wrong( 'wds_set_media_as_feature_image', esc_html( 'This function has been replaced with wds_check_if_content_contains_video', 'automatic-featured-images-from-videos' ), '4.6' );
76
+
_doing_it_wrong( 'wds_set_media_as_feature_image', esc_html__( 'This function has been replaced with wds_check_if_content_contains_video', 'automatic-featured-images-from-videos' ), '4.6' );
77
77
}
78
78
79
79
/**
@@ -94,22 +94,20 @@ function wds_check_if_content_contains_video( $post_id, $post ) {
94
94
95
95
// We need to prevent trying to assign when trashing or untrashing posts in the list screen.
96
96
// get_current_screen() was not providing a unique enough value to use here.
If a YouTube or Vimeo video exists in the first portion of a post, automatically set the post's featured image to that video's thumbnail.
13
+
If a YouTube or Vimeo video embed exists near the start of a post, we'll automatically set the post's featured image to a thumbnail of the video.
13
14
14
15
== Description ==
15
16
16
-
When placing a YouTube or Vimeo video within the first 800 characters of a post, the thumbnail of that video will automatically be sideloaded and set as the featured image for the post as long as the post does not already have a featured image set.
17
+
When placing a YouTube or Vimeo video within the first 4000 characters of a post, the thumbnail of that video will automatically be uploaded and set as the featured image for the post as long as the post does not already have a set featured image.
17
18
18
19
In addition, after setting the video thumbnail as the featured image, an “is_video” post meta field is updated to allow for the use of conditional statements within your loop.
19
20
@@ -39,6 +40,16 @@ In addition, after setting the video thumbnail as the featured image, an “is_v
39
40
40
41
== Changelog ==
41
42
43
+
= 1.2.0 =
44
+
* Added: Support for potentially larger Vimeo images from API response.
45
+
* Fixed: Various PHP notices and errors.
46
+
* Updated: Minimum PHP version.
47
+
* Updated: bumped up default string length to 4000 characters, for URL searching in content.
48
+
* Updated: exclude user profile URLs from Youtube regex.
49
+
* Updated: Switched all endpoints to make sure we're using HTTPS.
50
+
* Updated: Vimeo endpoint switched to JSON responses.
51
+
* Updated: Plugin description.
52
+
42
53
= 1.1.2 =
43
54
* Fixed: Issues with Youtube HEAD request returning 40x errors.
0 commit comments