Changeset 50658
- Timestamp:
- 04/05/2021 10:48:11 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-importer.php
r49196 r50658 15 15 * 16 16 * @param string $importer_name 17 * @param string $b id17 * @param string $blog_id 18 18 * @return array 19 19 */ 20 public function get_imported_posts( $importer_name, $b id ) {20 public function get_imported_posts( $importer_name, $blog_id ) { 21 21 global $wpdb; 22 22 … … 28 28 // Grab all posts in chunks. 29 29 do { 30 $meta_key = $importer_name . '_' . $b id . '_permalink';30 $meta_key = $importer_name . '_' . $blog_id . '_permalink'; 31 31 $sql = $wpdb->prepare( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = %s LIMIT %d,%d", $meta_key, $offset, $limit ); 32 32 $results = $wpdb->get_results( $sql ); … … 55 55 * 56 56 * @param string $importer_name 57 * @param string $b id57 * @param string $blog_id 58 58 * @return int 59 59 */ 60 public function count_imported_posts( $importer_name, $b id ) {60 public function count_imported_posts( $importer_name, $blog_id ) { 61 61 global $wpdb; 62 62 … … 64 64 65 65 // Get count of permalinks. 66 $meta_key = $importer_name . '_' . $b id . '_permalink';66 $meta_key = $importer_name . '_' . $blog_id . '_permalink'; 67 67 $sql = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key ); 68 68 … … 84 84 * @global wpdb $wpdb WordPress database abstraction object. 85 85 * 86 * @param string $b id86 * @param string $blog_id 87 87 * @return array 88 88 */ 89 public function get_imported_comments( $b id ) {89 public function get_imported_comments( $blog_id ) { 90 90 global $wpdb; 91 91 … … 106 106 foreach ( $results as $r ) { 107 107 // Explode comment_agent key. 108 list ( $ca_bid, $source_comment_id ) = explode( '-', $r->comment_agent ); 109 $source_comment_id = (int) $source_comment_id; 108 list ( $comment_agent_blog_id, $source_comment_id ) = explode( '-', $r->comment_agent ); 109 110 $source_comment_id = (int) $source_comment_id; 110 111 111 112 // Check if this comment came from this blog. 112 if ( $b id == $ca_bid ) {113 if ( $blog_id == $comment_agent_blog_id ) { 113 114 $hashtable[ $source_comment_id ] = (int) $r->comment_ID; 114 115 }
Note: See TracChangeset
for help on using the changeset viewer.