Opened 7 months ago
Closed 7 months ago
#22372 closed defect (bug) (invalid)
Bug in wp_attachment_is_image
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Media | Version: | 3.4.2 |
| Severity: | trivial | Keywords: | |
| Cc: |
Description
On wp-includes/post.php
Line 4031:
if ( !$file = get_attached_file( $post->ID ) )
SHOULD BE:
if ( !$file = get_attached_file( $post_id ) )
By the way, the variable name $post_id is very bad, as this is the Attachment ID, not the Post ID. Probably this variable naming mistake resulted in this bug.
Change History (1)
comment:1
SergeyBiryukov — 7 months ago
- Component changed from General to Media
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Severity changed from major to trivial
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.

$post->ID is actually the same value, since $post is set earlier in line 4028:
http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/post.php#L4028
It could be $post_id as well, but there's no bug here.