[wp-trac] Re: [WordPress Trac] #8958: Huge amount rewrite rules for page revisions after upgrade

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 25 21:38:42 GMT 2009


#8958: Huge amount rewrite rules for page revisions after upgrade
--------------------------------------------------------------+-------------
 Reporter:  matthijs                                          |        Owner:  ryan
     Type:  defect (bug)                                      |       Status:  new 
 Priority:  normal                                            |    Milestone:  2.8 
Component:  Permalinks                                        |      Version:  2.7 
 Severity:  major                                             |   Resolution:      
 Keywords:  permalinks, rewrite_rules, revisions needs-patch  |  
--------------------------------------------------------------+-------------
Changes (by westi):

  * keywords:  permalinks, rewrite_rules, revisions reporter-feedback =>
               permalinks, rewrite_rules, revisions needs-
               patch
  * milestone:  => 2.8

Comment:

 Looking into this a little more it's not easy I don't think at the moment
 to tell if a post_attachment is used or not :-(

 The offending code in wp-includes/rewrite.php is:

 {{{
 $attachments = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name,
 post_parent FROM $wpdb->posts WHERE post_type = 'attachment' AND
 post_parent = %d", $id ));
 }}}

 Which pulls all attachment into the mix - attachments have a post_status
 of inherit at the moment so it's not easy to modify that query to pick out
 the visible ones.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8958#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list