Changeset 862503
- Timestamp:
- 02/21/2014 05:57:36 PM (12 years ago)
- Location:
- video-thumbnails
- Files:
-
- 2 added
- 4 deleted
- 4 edited
- 26 copied
-
tags/2.6.2 (copied) (copied from video-thumbnails/trunk)
-
tags/2.6.2/css (copied) (copied from video-thumbnails/trunk/css)
-
tags/2.6.2/js/bulk.js (copied) (copied from video-thumbnails/trunk/js/bulk.js)
-
tags/2.6.2/js/clear.js (deleted)
-
tags/2.6.2/js/settings.js (added)
-
tags/2.6.2/js/test.js (deleted)
-
tags/2.6.2/php/class-video-thumbnails-settings.php (copied) (copied from video-thumbnails/trunk/php/class-video-thumbnails-settings.php) (3 diffs)
-
tags/2.6.2/php/extensions/class-ayvp-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/extensions/class-ayvp-thumbnails.php)
-
tags/2.6.2/php/providers/class-blip-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-blip-thumbnails.php)
-
tags/2.6.2/php/providers/class-collegehumor-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-collegehumor-thumbnails.php)
-
tags/2.6.2/php/providers/class-dailymotion-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-dailymotion-thumbnails.php)
-
tags/2.6.2/php/providers/class-facebook-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-facebook-thumbnails.php)
-
tags/2.6.2/php/providers/class-funnyordie-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-funnyordie-thumbnails.php)
-
tags/2.6.2/php/providers/class-googledrive-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-googledrive-thumbnails.php)
-
tags/2.6.2/php/providers/class-justintv-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-justintv-thumbnails.php)
-
tags/2.6.2/php/providers/class-kaltura-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-kaltura-thumbnails.php)
-
tags/2.6.2/php/providers/class-metacafe-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-metacafe-thumbnails.php)
-
tags/2.6.2/php/providers/class-mpora-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-mpora-thumbnails.php)
-
tags/2.6.2/php/providers/class-rutube-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-rutube-thumbnails.php)
-
tags/2.6.2/php/providers/class-twitch-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-twitch-thumbnails.php)
-
tags/2.6.2/php/providers/class-video-thumbnails-providers.php (copied) (copied from video-thumbnails/trunk/php/providers/class-video-thumbnails-providers.php)
-
tags/2.6.2/php/providers/class-vimeo-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-vimeo-thumbnails.php) (2 diffs)
-
tags/2.6.2/php/providers/class-vine-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-vine-thumbnails.php)
-
tags/2.6.2/php/providers/class-vk-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-vk-thumbnails.php)
-
tags/2.6.2/php/providers/class-wistia-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-wistia-thumbnails.php)
-
tags/2.6.2/php/providers/class-youku-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-youku-thumbnails.php)
-
tags/2.6.2/php/providers/class-youtube-thumbnails.php (copied) (copied from video-thumbnails/trunk/php/providers/class-youtube-thumbnails.php)
-
tags/2.6.2/readme.txt (copied) (copied from video-thumbnails/trunk/readme.txt) (2 diffs)
-
tags/2.6.2/video-thumbnails.php (copied) (copied from video-thumbnails/trunk/video-thumbnails.php) (3 diffs)
-
trunk/js/clear.js (deleted)
-
trunk/js/settings.js (added)
-
trunk/js/test.js (deleted)
-
trunk/php/class-video-thumbnails-settings.php (modified) (3 diffs)
-
trunk/php/providers/class-vimeo-thumbnails.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/video-thumbnails.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
video-thumbnails/tags/2.6.2/php/class-video-thumbnails-settings.php
r859638 r862503 38 38 // Initialize options 39 39 add_action( 'admin_init', array( &$this, 'initialize_options' ) ); 40 // Custom field detection callback 41 add_action( 'wp_ajax_video_thumbnail_custom_field_detection', array( &$this, 'custom_field_detection_callback' ) ); 40 42 // Ajax clear all callback 41 43 add_action( 'wp_ajax_clear_all_video_thumbnails', array( &$this, 'ajax_clear_all_callback' ) ); … … 134 136 135 137 function admin_scripts() { 136 wp_enqueue_script( 'video_thumbnails_test', plugins_url( 'js/test.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) ); 137 wp_enqueue_script( 'video_thumbnails_clear', plugins_url( 'js/clear.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) ); 138 wp_enqueue_script( 'video_thumbnails_settings', plugins_url( 'js/settings.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION ); 139 } 140 141 function custom_field_detection_callback() { 142 if ( current_user_can( 'manage_options' ) ) { 143 echo $this->detect_custom_field(); 144 } 145 die(); 146 } 147 148 function detect_custom_field() { 149 global $video_thumbnails; 150 $latest_post = get_posts( array( 151 'posts_per_page' => 1, 152 'post_type' => $this->options['post_types'], 153 'orderby' => 'modified', 154 ) ); 155 $latest_post = $latest_post[0]; 156 $custom = get_post_meta( $latest_post->ID ); 157 foreach ( $custom as $name => $values ) { 158 foreach ($values as $value) { 159 if ( $video_thumbnails->get_first_thumbnail_url( $value ) ) { 160 return $name; 161 } 162 } 163 } 138 164 } 139 165 … … 323 349 'custom_field', 324 350 'Custom Field (optional)', 325 ' Enter the name of the custom field where your embed code or video URL is stored.'351 '<a href="#" class="button" id="vt_detect_custom_field">Automatically Detect</a> Enter the name of the custom field where your embed code or video URL is stored.' 326 352 ); 327 353 register_setting( 'video_thumbnails', 'video_thumbnails', array( &$this, 'sanitize_callback' ) ); -
video-thumbnails/tags/2.6.2/php/providers/class-vimeo-thumbnails.php
r846693 r862503 85 85 $result = $response->thumbnails->thumbnail[count($response->thumbnails->thumbnail)-1]->_content; 86 86 } else { 87 $request = "http://vimeo.com/api/oembed. xml?url=http%3A//vimeo.com/$id";87 $request = "http://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/$id"; 88 88 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 89 89 if( is_wp_error( $response ) ) { … … 94 94 $result = new WP_Error( 'vimeo_info_retrieval', __( 'The Vimeo endpoint located at <a href="' . $request . '">' . $request . '</a> returned a 403 error.<br />This can occur when a video has embedding disabled or restricted to certain domains. Try entering API credentials in the provider settings.' ) ); 95 95 } else { 96 $ xml = new SimpleXMLElement( $response['body'] );97 $result = (string) $xml->thumbnail_url;96 $result = json_decode( $response['body'] ); 97 $result = $result->thumbnail_url; 98 98 } 99 99 } -
video-thumbnails/tags/2.6.2/readme.txt
r859790 r862503 5 5 Requires at least: 3.2 6 6 Tested up to: 3.8.1 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 9 9 Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template. … … 118 118 119 119 == Changelog == 120 121 = 2.6.2 = 122 * Added feature to settings page that automatically detects the custom field 123 * Switched to JSON for Vimeo's oEmbed endpoint 124 * Added support for the "image/gif" MIME type 120 125 121 126 = 2.6.1 = -
video-thumbnails/tags/2.6.2/video-thumbnails.php
r859790 r862503 6 6 Author: Sutherland Boswell 7 7 Author URI: http://sutherlandboswell.com 8 Version: 2.6. 18 Version: 2.6.2 9 9 License: GPL2 10 10 */ … … 29 29 define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) ); 30 30 define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' ); 31 define( 'VIDEO_THUMBNAILS_VERSION', '2.6. 1' );31 define( 'VIDEO_THUMBNAILS_VERSION', '2.6.2' ); 32 32 33 33 // Providers … … 331 331 } elseif ( $image_type == 'image/png' ) { 332 332 $image_extension = '.png'; 333 } elseif ( $image_type == 'image/gif' ) { 334 $image_extension = '.gif'; 333 335 } else { 334 336 return new WP_Error( 'thumbnail_upload', __( 'Unsupported MIME type:' ) . ' ' . $image_type ); -
video-thumbnails/trunk/php/class-video-thumbnails-settings.php
r859638 r862503 38 38 // Initialize options 39 39 add_action( 'admin_init', array( &$this, 'initialize_options' ) ); 40 // Custom field detection callback 41 add_action( 'wp_ajax_video_thumbnail_custom_field_detection', array( &$this, 'custom_field_detection_callback' ) ); 40 42 // Ajax clear all callback 41 43 add_action( 'wp_ajax_clear_all_video_thumbnails', array( &$this, 'ajax_clear_all_callback' ) ); … … 134 136 135 137 function admin_scripts() { 136 wp_enqueue_script( 'video_thumbnails_test', plugins_url( 'js/test.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) ); 137 wp_enqueue_script( 'video_thumbnails_clear', plugins_url( 'js/clear.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ) ); 138 wp_enqueue_script( 'video_thumbnails_settings', plugins_url( 'js/settings.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION ); 139 } 140 141 function custom_field_detection_callback() { 142 if ( current_user_can( 'manage_options' ) ) { 143 echo $this->detect_custom_field(); 144 } 145 die(); 146 } 147 148 function detect_custom_field() { 149 global $video_thumbnails; 150 $latest_post = get_posts( array( 151 'posts_per_page' => 1, 152 'post_type' => $this->options['post_types'], 153 'orderby' => 'modified', 154 ) ); 155 $latest_post = $latest_post[0]; 156 $custom = get_post_meta( $latest_post->ID ); 157 foreach ( $custom as $name => $values ) { 158 foreach ($values as $value) { 159 if ( $video_thumbnails->get_first_thumbnail_url( $value ) ) { 160 return $name; 161 } 162 } 163 } 138 164 } 139 165 … … 323 349 'custom_field', 324 350 'Custom Field (optional)', 325 ' Enter the name of the custom field where your embed code or video URL is stored.'351 '<a href="#" class="button" id="vt_detect_custom_field">Automatically Detect</a> Enter the name of the custom field where your embed code or video URL is stored.' 326 352 ); 327 353 register_setting( 'video_thumbnails', 'video_thumbnails', array( &$this, 'sanitize_callback' ) ); -
video-thumbnails/trunk/php/providers/class-vimeo-thumbnails.php
r846693 r862503 85 85 $result = $response->thumbnails->thumbnail[count($response->thumbnails->thumbnail)-1]->_content; 86 86 } else { 87 $request = "http://vimeo.com/api/oembed. xml?url=http%3A//vimeo.com/$id";87 $request = "http://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/$id"; 88 88 $response = wp_remote_get( $request, array( 'sslverify' => false ) ); 89 89 if( is_wp_error( $response ) ) { … … 94 94 $result = new WP_Error( 'vimeo_info_retrieval', __( 'The Vimeo endpoint located at <a href="' . $request . '">' . $request . '</a> returned a 403 error.<br />This can occur when a video has embedding disabled or restricted to certain domains. Try entering API credentials in the provider settings.' ) ); 95 95 } else { 96 $ xml = new SimpleXMLElement( $response['body'] );97 $result = (string) $xml->thumbnail_url;96 $result = json_decode( $response['body'] ); 97 $result = $result->thumbnail_url; 98 98 } 99 99 } -
video-thumbnails/trunk/readme.txt
r859790 r862503 5 5 Requires at least: 3.2 6 6 Tested up to: 3.8.1 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 9 9 Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template. … … 118 118 119 119 == Changelog == 120 121 = 2.6.2 = 122 * Added feature to settings page that automatically detects the custom field 123 * Switched to JSON for Vimeo's oEmbed endpoint 124 * Added support for the "image/gif" MIME type 120 125 121 126 = 2.6.1 = -
video-thumbnails/trunk/video-thumbnails.php
r859790 r862503 6 6 Author: Sutherland Boswell 7 7 Author URI: http://sutherlandboswell.com 8 Version: 2.6. 18 Version: 2.6.2 9 9 License: GPL2 10 10 */ … … 29 29 define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) ); 30 30 define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' ); 31 define( 'VIDEO_THUMBNAILS_VERSION', '2.6. 1' );31 define( 'VIDEO_THUMBNAILS_VERSION', '2.6.2' ); 32 32 33 33 // Providers … … 331 331 } elseif ( $image_type == 'image/png' ) { 332 332 $image_extension = '.png'; 333 } elseif ( $image_type == 'image/gif' ) { 334 $image_extension = '.gif'; 333 335 } else { 334 336 return new WP_Error( 'thumbnail_upload', __( 'Unsupported MIME type:' ) . ' ' . $image_type );
Note: See TracChangeset
for help on using the changeset viewer.