Ticket #20206: 20206.patch
File 20206.patch, 1.6 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/export.php
45 45 if ( ! $ptype->can_export ) 46 46 $args['content'] = 'post'; 47 47 48 $post_types = array( $args['content'] ); 48 49 $where = $wpdb->prepare( "{$wpdb->posts}.post_type = %s", $args['content'] ); 49 50 } else { 50 51 $post_types = get_post_types( array( 'can_export' => true ) ); … … 234 235 * 235 236 * @since 3.1.0 236 237 */ 237 function wxr_authors_list( ) {238 function wxr_authors_list( $post_types ) { 238 239 global $wpdb; 239 240 240 241 $authors = array(); 241 $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts" ); 242 $esses = array_fill( 0, count($post_types), '%s' ); 243 $results = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE {$wpdb->posts}.post_type IN (" . implode( ',', $esses ) . ')', $post_types ) ); 244 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_types ); ?> 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>