Changeset 28731
- Timestamp:
- 06/10/2014 07:14:26 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/export.php
r28500 r28731 241 241 * 242 242 * @since 3.1.0 243 */ 244 function wxr_authors_list() { 243 * 244 * @param array $post_ids Array of post IDs to filter the query by. Optional. 245 */ 246 function wxr_authors_list( array $post_ids = null ) { 245 247 global $wpdb; 246 248 249 if ( !empty( $post_ids ) ) { 250 $post_ids = array_map( 'absint', $post_ids ); 251 $and = 'AND ID IN ( ' . implode( ', ', $post_ids ) . ')'; 252 } else { 253 $and = ''; 254 } 255 247 256 $authors = array(); 248 $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' " );257 $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" ); 249 258 foreach ( (array) $results as $result ) 250 259 $authors[] = get_userdata( $result->post_author ); … … 345 354 <wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url> 346 355 347 <?php wxr_authors_list( ); ?>356 <?php wxr_authors_list( $post_ids ); ?> 348 357 349 358 <?php foreach ( $cats as $c ) : ?>
Note: See TracChangeset
for help on using the changeset viewer.