Changeset 667274
- Timestamp:
- 02/13/2013 08:34:59 AM (13 years ago)
- Location:
- lean-media/trunk
- Files:
-
- 2 edited
-
lean-media.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lean-media/trunk/lean-media.php
r645251 r667274 4 4 Plugin URI: http://codemaster.fi/wordpress/plugins/lean-media/ 5 5 Description: Delete large image files 6 Version: 1.0 6 Version: 1.0.1 7 7 Author: S H Mohanjith (Code Master Oy) 8 8 Author URI: http://codemaster.fi/ … … 16 16 17 17 if (get_option('lean_media_settings-delete_large_files', 1) == 1) { 18 add_filter('wp_generate_attachment_metadata', 'lean_media_delete_fullsize_image' );18 add_filter('wp_generate_attachment_metadata', 'lean_media_delete_fullsize_image', 100, 2); 19 19 } 20 20 } … … 25 25 } 26 26 27 function lean_media_delete_fullsize_image($metadata ) {27 function lean_media_delete_fullsize_image($metadata, $attachment_id) { 28 28 29 29 $upload_dir = wp_upload_dir(); … … 32 32 $width = 0; 33 33 $height = 0; 34 34 35 if ( get_post_meta($attachment_id, '_wp_attachment_context', true) == 'custom-background' ) { 36 return $metadata; 37 } 38 35 39 foreach ($metadata['sizes'] as $thumbnail) { 36 40 if ($thumbnail['width'] > $width) { -
lean-media/trunk/readme.txt
r645256 r667274 1 1 === Lean Media === 2 Contributors: codix, mohanjith 2 Contributors: codix, mohanjith, WPMUDEV 3 3 Donate link: http://twitter.com/codemasteroy 4 4 Tags: media, thumbnail, storage, save
Note: See TracChangeset
for help on using the changeset viewer.