Changeset 2555 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-wporg-plugin-directory-tools.php
- Timestamp:
- 02/23/2016 04:12:32 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-wporg-plugin-directory-tools.php
r2501 r2555 24 24 25 25 // Sanitize contributors. 26 var_dump($data);27 26 foreach ( $data->contributors as $i => $name ) { 28 27 if ( get_user_by( 'login', $name ) ) { … … 38 37 return $data; 39 38 } 39 40 /** 41 * Retrieve the average color of a specified image. 42 * This currently relies upon the Jetpack libraries. 43 * 44 * @param $file_location string URL or filepath of image 45 * @return string|bool Average color as a hex value, False on failure 46 */ 47 static function get_image_average_color( $file_location ) { 48 if ( ! class_exists( 'Tonesque' ) && function_exists( 'jetpack_require_lib' ) ) { 49 jetpack_require_lib( 'tonesque' ); 50 } 51 if ( ! class_exists( 'Tonesque' ) ) { 52 return false; 53 } 54 55 $tonesque = new Tonesque( $file_location ); 56 if ( $tonesque ) { 57 return $tonesque->color(); 58 } 59 60 return false; 61 } 40 62 }
Note: See TracChangeset
for help on using the changeset viewer.