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

WordPress Trac wp-trac at lists.automattic.com
Mon May 11 00:22:14 GMT 2009


#8958: Huge amount rewrite rules for page revisions after upgrade
--------------------------+-------------------------------------------------
 Reporter:  matthijs      |       Owner:  ryan                    
     Type:  defect (bug)  |      Status:  new                     
 Priority:  normal        |   Milestone:  Future Release          
Component:  Permalinks    |     Version:  2.7                     
 Severity:  major         |    Keywords:  needs-patch dev-feedback
--------------------------+-------------------------------------------------
Changes (by robinmarshall):

 * cc: robinmarshall (added)


Comment:

 What about just getting the id's of pages with attachments then checking
 if the page id is in the list before running the query?

 e.g.


 {{{
 $all_attachments = $wpdb->get_results("SELECT post_parent FROM
 $wpdb->posts WHERE post_type = 'attachment'");

 foreach ($posts as $id => $post) {
         if (!in_array($id,$all_attachments)) continue;
 }}}

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


More information about the wp-trac mailing list