Changeset 60632
- Timestamp:
- 08/13/2025 04:26:33 PM (8 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/export.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/export.php
r60630 r60632 406 406 407 407 if ( ! empty( $post_ids ) ) { 408 $post_ids = array_map( 'absint', $post_ids );409 $ and = 'AND ID IN ( ' . implode( ', ', $post_ids ) . ')';408 $post_ids = array_map( 'absint', $post_ids ); 409 $post_id_chunks = array_chunk( $post_ids, 20 ); 410 410 } else { 411 $ and = '';411 $post_id_chunks = array( array() ); 412 412 } 413 413 414 414 $authors = array(); 415 $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" ); 416 foreach ( (array) $results as $result ) { 417 $authors[] = get_userdata( $result->post_author ); 415 416 foreach ( $post_id_chunks as $next_posts ) { 417 $and = ! empty( $next_posts ) ? 'AND ID IN (' . implode( ', ', $next_posts ) . ')' : ''; 418 419 $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" ); 420 421 foreach ( (array) $results as $result ) { 422 $authors[] = get_userdata( $result->post_author ); 423 } 418 424 } 419 425 420 426 $authors = array_filter( $authors ); 427 $authors = array_unique( $authors, SORT_REGULAR ); // Remove duplicate authors. 421 428 422 429 foreach ( $authors as $author ) {
Note: See TracChangeset
for help on using the changeset viewer.