[wp-trac] [WordPress Trac] #16830: url_to_postid() doesn't resolve attachments when rewrite rules are disabled

WordPress Trac noreply at wordpress.org
Sat Aug 17 21:25:30 UTC 2013


#16830: url_to_postid() doesn't resolve attachments when rewrite rules are disabled
-----------------------------+------------------------------
 Reporter:  Coolkevman       |       Owner:
     Type:  feature request  |      Status:  reopened
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Rewrite Rules    |     Version:  1.2
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |
-----------------------------+------------------------------
Changes (by MikeSchinkel):

 * keywords:   => needs-patch
 * status:  closed => reopened
 * resolution:  invalid =>
 * type:  defect (bug) => feature request


Comment:

 Replying to [comment:5 c3mdigital]:
 > I can't think of a use case for needing the attachment_id when you have
 the full url to the actual image, maybe to get the attachment meta data?
 I'm closing but if anyone has a use case that I'm missing please reopen.

 One reason you mention is attachment meta data.

 Further, most ''(all?)'' of the `wp_get_attachment()` functions expect an
 attachment post ID, so I can very much see how this would be useful for
 more advanced WordPress development, for example to parse URLs out of user
 entered content to match up with attachments or to parse the URL out of a
 feed for a site that has its database on the same MySQL server as the site
 with running, and to determine it's ID in the other site's database ''(we
 are doing both of these on my current project.)''

 However, the implementation of this function needs to be more complex than
 to just check against the `guid` because that can fail.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/16830#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list