Ticket #20206: 20206.2.diff
File 20206.2.diff, 1.3 KB (added by , 12 years ago) |
---|
-
export.php
233 233 * Output list of authors with posts 234 234 * 235 235 * @since 3.1.0 236 * 237 * @param array $post_ids Array of post IDs to include in the query 236 238 */ 237 function wxr_authors_list( ) {239 function wxr_authors_list( $post_ids ) { 238 240 global $wpdb; 239 241 240 242 $authors = array(); 241 $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts" ); 243 $where = 'WHERE ID IN (' . join( ',', $post_ids ) . ')'; 244 $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts $where" ); 242 245 foreach ( (array) $results as $result ) 243 246 $authors[] = get_userdata( $result->post_author ); 244 247 … … 337 340 <wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url> 338 341 <wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url> 339 342 340 <?php wxr_authors_list( ); ?>343 <?php wxr_authors_list( $post_ids ); ?> 341 344 342 345 <?php foreach ( $cats as $c ) : ?> 343 346 <wp:category><wp:term_id><?php echo $c->term_id ?></wp:term_id><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->slug : ''; ?></wp:category_parent><?php wxr_cat_name( $c ); ?><?php wxr_category_description( $c ); ?></wp:category>