WordPress.org

Plugin Directory

Changeset 492834


Ignore:
Timestamp:
01/20/12 22:02:50 (2 years ago)
Author:
MadtownLems
Message:

fixed small bug that could affect cached mediafilesizes during upgrading

Location:
media-file-sizes/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • media-file-sizes/trunk/media_file_sizes.php

    r481220 r492834  
    55Description: Displays file sizes next to media items in library.  (For image files, also displays total size of all generated sizes.) 
    66Author: Jason Lemahieu 
    7 Version: 1.4 
     7Version: 1.5 
    88*/ 
    99 
     
    149149            $space = filesize($upload_base_dir . "/" . $path); 
    150150             
    151              
    152151            $return_array['original'] = $space; 
    153152            update_post_meta($id, 'mediafilesize', $return_array['original']); 
     
    155154        } 
    156155         
    157          
    158              
    159156        return $return_array; 
    160157    } 
     
    170167            foreach ($attachments as $post) { 
    171168                setup_postdata($post); 
    172                 $size = mediafilesizes_get_size($post->ID); 
     169                $sizearray = mediafilesizes_get_size($post->ID); 
     170                 
     171                if (isset($sizearray['total']) && $sizearray['total'] != '') { 
     172                    $size = $sizearray['total']; 
     173                } else { 
     174                    $size = $sizearray['original']; 
     175                } 
    173176                update_post_meta($post->ID, 'mediafilesize', $size); 
    174177            } 
     
    198201        $version = get_option('mediafilesize_version', '0'); 
    199202        $version = (float) $version; 
    200         if ($version < 1.4) { 
     203        if ($version < 1.5) { 
    201204            mediafilesizes_clear_metadata(); 
    202205            mediafilesizes_run_metadata(); 
    203             update_option('mediafilesize_version', '1.4'); 
     206            update_option('mediafilesize_version', '1.5'); 
    204207        }    
    205208    } 
  • media-file-sizes/trunk/readme.txt

    r481220 r492834  
    3030== Changelog == 
    3131 
     32= 1.5 = 
     33* Minor bug update that could affect cached mediafilesize values during upgrade 
     34 
    3235= 1.4 = 
    3336* Minor bug updates that may affect functionality on some environments 
Note: See TracChangeset for help on using the changeset viewer.