[wp-trac] [WordPress Trac] #11312: Add 'handle_404' hook to allow plugins to route URLs

WordPress Trac wp-trac at lists.automattic.com
Thu Jul 8 12:47:40 UTC 2010


#11312: Add 'handle_404' hook to allow plugins to route URLs
--------------------------------------+-------------------------------------
 Reporter:  mikeschinkel              |        Owner:  ryan    
     Type:  enhancement               |       Status:  reopened
 Priority:  normal                    |    Milestone:          
Component:  Rewrite Rules             |      Version:          
 Severity:  normal                    |   Resolution:          
 Keywords:  needs-patch dev-feedback  |  
--------------------------------------+-------------------------------------
Changes (by simonwheatley):

 * cc: simon@… (added)
  * status:  closed => reopened
  * resolution:  invalid =>


Comment:

 Here's my use case for this patch or similar functionality: I'm creating a
 plugin against WP3.0 which adds a comment archive page for every
 registered user, very similar to the post archive page for authors, but,
 you know, for comments.

 I've added rewrite rules for it, e.g.
 http://example.com/member/someone/comments and hooked WP_Query to have it
 issue appropriate queries to get the comments. This works fine... until
 you get to the pagination URLs, e.g.
 http://example.com/member/someone/comments/page/2. At this point the hard
 coded rules in handle_404 kick in and., as no posts are found AND it's a
 paginated query, the status is set to 404. I would argue that this isn't
 accurate on both levels, it's not intended to be a 404 AND WP_Query HAS
 found content, the content just doesn't happen to be posts.

 I understand that I can override the status later, as you suggest Otto42,
 but it really feels like the cleaner, more semantically correct solution
 would be to override WP's instinct to set 404 at this point.

 Who's with me? :)

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


More information about the wp-trac mailing list