[wp-trac] [WordPress Trac] #5553: add_rewrite_endpoint does not work

WordPress Trac wp-trac at lists.automattic.com
Mon Dec 31 11:55:01 GMT 2007


#5553: add_rewrite_endpoint does not work
---------------------+------------------------------------------------------
 Reporter:  Curioso  |       Owner:  anonymous
     Type:  defect   |      Status:  new      
 Priority:  normal   |   Milestone:  2.5      
Component:  General  |     Version:           
 Severity:  normal   |    Keywords:           
---------------------+------------------------------------------------------
 The functionality for adding endpoints in rewrite rules does not work for
 attachments.
 In wp-includes/rewrite.php:

 {{{
                     //do endpoints for attachments
                     if ($endpoint) { foreach ($ep_query_append as $regex
 => $ep) {
                         if ($ep[0] & EP_ATTACHMENT) {
                             $rewrite[$sub1 . $regex] = $subquery . '?' .
 $ep[1] . $this->preg_index(2);
                             $rewrite[$sub2 . $regex] = $subquery . '?' .
 $ep[1] . $this->preg_index(2);
                         }
                     } }
 }}}
 should be:

 {{{
                     //do endpoints for attachments
                     if ($endpoints) { foreach ($ep_query_append as $regex
 => $ep) {
                         if ($ep[0] & EP_ATTACHMENT) {
                             $rewrite[$sub1 . $regex] = $subquery . $ep[1]
 . $this->preg_index(2);
                             $rewrite[$sub2 . $regex] = $subquery . $ep[1]
 . $this->preg_index(2);
                         }
                     } }
 }}}
 Note the typing error in $endpoints, and the '?' is already present in
 $subquery.

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


More information about the wp-trac mailing list