Video Thumbnails - Version 2.10.2

Version Description

  • Added actions hooks before and after generating attachment metadata
Download this release

Release Info

Developer sutherlandboswell
Plugin Icon 128x128 Video Thumbnails
Version 2.10.2
Comparing to
See all releases

Code changes from version 2.10.1 to 2.10.2

php/class-video-thumbnails-settings.php CHANGED
@@ -281,8 +281,8 @@ class Video_Thumbnails_Settings {
281
 
282
  if ( !current_user_can( 'manage_options' ) ) die();
283
 
284
- // Try saving 'http://img.youtube.com/vi/dMH0bHeiRNg/0.jpg' to media library
285
- $attachment_id = Video_Thumbnails::save_to_media_library( 'http://img.youtube.com/vi/dMH0bHeiRNg/0.jpg', 1 );
286
  if ( is_wp_error( $attachment_id ) ) {
287
  echo '<p><span style="color:red;">&#10006;</span> ' . $attachment_id->get_error_message() . '</p>';
288
  } else {
281
 
282
  if ( !current_user_can( 'manage_options' ) ) die();
283
 
284
+ // Try saving 'http://img.youtube.com/vi/aKAGU2jkaNg/maxresdefault.jpg' to media library
285
+ $attachment_id = Video_Thumbnails::save_to_media_library( 'http://img.youtube.com/vi/aKAGU2jkaNg/maxresdefault.jpg', 1 );
286
  if ( is_wp_error( $attachment_id ) ) {
287
  echo '<p><span style="color:red;">&#10006;</span> ' . $attachment_id->get_error_message() . '</p>';
288
  } else {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wie.ly/u/donate
4
  Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image
5
  Requires at least: 3.2
6
  Tested up to: 3.9.2
7
- Stable tag: 2.10.1
8
 
9
  Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
10
 
@@ -131,6 +131,9 @@ The Vimeo API has a rate limit, so in rare cases you may exceed this limit. Try
131
 
132
  == Changelog ==
133
 
 
 
 
134
  = 2.10.1 =
135
  * Removed Justin.tv due to their shutdown
136
 
4
  Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image
5
  Requires at least: 3.2
6
  Tested up to: 3.9.2
7
+ Stable tag: 2.10.2
8
 
9
  Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
10
 
131
 
132
  == Changelog ==
133
 
134
+ = 2.10.2 =
135
+ * Added actions hooks before and after generating attachment metadata
136
+
137
  = 2.10.1 =
138
  * Removed Justin.tv due to their shutdown
139
 
video-thumbnails.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://refactored.co/plugins/video-thumbnails
5
  Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Supports YouTube, Vimeo, Facebook, Vine, Justin.tv, Twitch, Dailymotion, Metacafe, VK, Blip, Google Drive, Funny or Die, CollegeHumor, MPORA, Wistia, Youku, and Rutube.
6
  Author: Sutherland Boswell
7
  Author URI: http://sutherlandboswell.com
8
- Version: 2.10.1
9
  License: GPL2
10
  Text Domain: video-thumbnails
11
  Domain Path: /languages/
@@ -30,7 +30,7 @@ Domain Path: /languages/
30
 
31
  define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
32
  define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
33
- define( 'VIDEO_THUMBNAILS_VERSION', '2.10.1' );
34
 
35
  // Providers
36
  require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/providers.php' );
@@ -404,7 +404,9 @@ class Video_Thumbnails {
404
  // you must first include the image.php file
405
  // for the function wp_generate_attachment_metadata() to work
406
  require_once( ABSPATH . 'wp-admin/includes/image.php' );
 
407
  $attach_data = wp_generate_attachment_metadata( $attach_id, $upload['file'] );
 
408
  wp_update_attachment_metadata( $attach_id, $attach_data );
409
 
410
  // Add field to mark image as a video thumbnail
5
  Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Supports YouTube, Vimeo, Facebook, Vine, Justin.tv, Twitch, Dailymotion, Metacafe, VK, Blip, Google Drive, Funny or Die, CollegeHumor, MPORA, Wistia, Youku, and Rutube.
6
  Author: Sutherland Boswell
7
  Author URI: http://sutherlandboswell.com
8
+ Version: 2.10.2
9
  License: GPL2
10
  Text Domain: video-thumbnails
11
  Domain Path: /languages/
30
 
31
  define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
32
  define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
33
+ define( 'VIDEO_THUMBNAILS_VERSION', '2.10.2' );
34
 
35
  // Providers
36
  require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/providers.php' );
404
  // you must first include the image.php file
405
  // for the function wp_generate_attachment_metadata() to work
406
  require_once( ABSPATH . 'wp-admin/includes/image.php' );
407
+ do_action( 'video_thumbnails/pre_generate_attachment_metadata', $attach_id, $upload['file'] );
408
  $attach_data = wp_generate_attachment_metadata( $attach_id, $upload['file'] );
409
+ do_action( 'video_thumbnails/after_generate_attachment_metadata', $attach_id, $upload['file'] );
410
  wp_update_attachment_metadata( $attach_id, $attach_data );
411
 
412
  // Add field to mark image as a video thumbnail