[wp-trac] [WordPress Trac] #24257: is_attachment() should accept $attachment parameter
WordPress Trac
noreply at wordpress.org
Sat Aug 10 03:45:35 UTC 2013
#24257: is_attachment() should accept $attachment parameter
-------------------------+------------------------------
Reporter: alex-ye | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 3.5.1
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+------------------------------
Changes (by alex-ye):
* keywords: close => has-patch
Comment:
Replying to [comment:3 wonderboymusic]:
> You aren't checking the `post_type` - nothing about that function is
attachment-specific, it could evaluate true against an arbitrarily-passed
post
I just make the patch like the is_page() function, We doesn't need to
check the post-type since we pass an attachment ID, title, slug, or array
of such.. so we don't need to check the Post object too.
You didn't give a reasons why the core doesn't add $attachment parameter.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24257#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list