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

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 11 01:09:15 UTC 2011


#16830: url_to_postid() doesn't resolve attachments when rewrite rules are disabled
---------------------------+-----------------------------
 Reporter:  Coolkevman     |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Rewrite Rules  |    Version:  3.1
 Severity:  normal         |   Keywords:
---------------------------+-----------------------------
 The code of {{{url_to_postid()}}} is pretty clear in the case of disabled
 rewrite rules: all URLs not using the {{{p=N}}}, {{{page_id=N}}} or
 {{{attachment_id=N}}} forms are not parsed and the function return 0. That
 make sense.

 Now there is a special case for attachments. Attachments can be saved
 under a the {{{/wp-content/uploads/year/month/}}} folder structure while
 rewrite rules are disabled at the same time.

 This means there is a missed opportunity for {{{url_to_postid()}}} to
 resolve attachment's URLs of the long-form when rewrite rules are
 disabled.

 This was tested and reproduced on WordPress 3.1.

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


More information about the wp-trac mailing list