[wp-trac] [WordPress Trac] #4435: Better dispaly for non-image attachements with long filenames

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 12 18:46:25 GMT 2007


#4435: Better dispaly for non-image attachements with long filenames
----------------------------+-----------------------------------------------
 Reporter:  apokalyptik     |       Owner:  anonymous
     Type:  enhancement     |      Status:  new      
 Priority:  normal          |   Milestone:           
Component:  Administration  |     Version:  2.2      
 Severity:  normal          |    Keywords:           
----------------------------+-----------------------------------------------
 {{{
 Index: wp-admin/upload-functions.php
 ===================================================================
 --- wp-admin/upload-functions.php       (revision 5682)
 +++ wp-admin/upload-functions.php       (working copy)
 @@ -26,6 +26,14 @@
                 $image_rel = wp_make_link_relative($image_src);
                 $innerHTML = ' ' . str_replace($image_src,
 $image_rel, $innerHTML);
                 $class = 'image';
 +       } elseif ( strlen($innerHTML) > 15 ) {
 +               $dot_position = strrpos($innerHTML, '.') + 1;
 +               $addendum = '';
 +               if ( $dot_position > 1 ) {
 +                       $extension = strtoupper(substr($innerHTML,
 $dot_position));
 +                       $addendum = '<br /><br />('.$extension.')';
 +               }
 +               $innerHTML = substr($innerHTML, 0, 11).'...'.$addendum;
         }

         $src_base = wp_get_attachment_url();
 @@ -356,4 +364,4 @@
         }
  }

 -?>
 \ No newline at end of file
 +?>
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4435>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list