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

WordPress Trac wp-trac at lists.automattic.com
Tue May 24 20:25:46 UTC 2011


#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       |   Keywords:
-------------------------+-----------------------------
 The query parameter `p` works for posts and pages but not attachments.
 When the ID in question refers to an attachment, the result is a 404. Why?

 When generating a stats report for a remote blog, the WordPress.com
 Stats/Jetpack system at first only knows the post_id of a new post.
 Eventually it learns the correct permalink by querying the blog, but until
 then its best guess at a working link is `?p=$post_id`.

 This problem (and possibly others) would be most easily solved by a core
 query parameter that can find any post_type by its ID alone. Unless there
 is a reason to limit `p`, I propose we make `p` work for all post_types.
 If there is a reason, how about a new public query parameter `post_id`?

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


More information about the wp-trac mailing list