[wp-trac] [WordPress Trac] #17551: Need a post_id query that works regardless of post_type.

WordPress Trac noreply at wordpress.org
Sun Sep 8 20:42:38 UTC 2013


#17551: Need a post_id query that works regardless of post_type.
-------------------------+------------------------------
 Reporter:  andy         |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Query        |     Version:  3.2
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |
-------------------------+------------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:4 dd32]:
 > Replying to [comment:3 solarissmoke]:
 > > But it doesn't issue a 404... it redirects to `?attachment_id=N`
 > Only when it's attached to a published post I believe.

 `?p=N` (where `N` is an attachment ID) redirects to the "proper" permalink
 if it's attached to a published post, and to `?attachment_id=N` otherwise
 (see [14355] and [14595]). I could not reproduce the 404 error neither in
 current trunk nor in 3.0.

 Replying to [comment:5 andy]:
 > Compare http://ma.tt/?p=38232 and http://ma.tt/?attachment_id=38232. The
 parent post is published yet the 'p=' query produces a 404, not a
 redirect.

 Both links now redirect to http://ma.tt/2011/05/balloon-ride/mcm_9083/.

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


More information about the wp-trac mailing list