[wp-trac] [WordPress Trac] #25170: Add actual file size to attachment publish meta box

WordPress Trac noreply at wordpress.org
Tue Sep 24 19:42:46 UTC 2013

#25170: Add actual file size to attachment publish meta box
 Reporter:  desrosj      |       Owner:  helen
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  3.7
Component:  Media        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |

Comment (by DrewAPicture):

 Replying to [comment:15 nacin]:
 > <snip>
 > And, yes, a file_exists() would be fine. I *don't* think it makes sense
 inside get_attached_file(), though, for replication reasons.
 get_attached_file() returns the path to where the file should be, but I'm
 not sure that's a "promise".
 > Either way, we need to make sure get_attached_file() returns a valid
 value before calling filesize() on it.

 I guess we'll need to change the return doc for `get_attached_file()` then
 as well:
 * @return string|bool The file path to the attached file, or false if the
 attachment does not exist.

Ticket URL: <http://core.trac.wordpress.org/ticket/25170#comment:17>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list