Changeset 47122 for trunk/src/wp-admin/includes/class-wp-importer.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/class-wp-importer.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-importer.php
r45730 r47122 26 26 $offset = 0; 27 27 28 // Grab all posts in chunks 28 // Grab all posts in chunks. 29 29 do { 30 30 $meta_key = $importer_name . '_' . $bid . '_permalink'; … … 32 32 $results = $wpdb->get_results( $sql ); 33 33 34 // Increment offset 34 // Increment offset. 35 35 $offset = ( $limit + $offset ); 36 36 37 37 if ( ! empty( $results ) ) { 38 38 foreach ( $results as $r ) { 39 // Set permalinks into array 39 // Set permalinks into array. 40 40 $hashtable[ $r->meta_value ] = intval( $r->post_id ); 41 41 } … … 63 63 $count = 0; 64 64 65 // Get count of permalinks 65 // Get count of permalinks. 66 66 $meta_key = $importer_name . '_' . $bid . '_permalink'; 67 67 $sql = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key ); … … 95 95 $offset = 0; 96 96 97 // Grab all comments in chunks 97 // Grab all comments in chunks. 98 98 do { 99 99 $sql = $wpdb->prepare( "SELECT comment_ID, comment_agent FROM $wpdb->comments LIMIT %d,%d", $offset, $limit ); 100 100 $results = $wpdb->get_results( $sql ); 101 101 102 // Increment offset 102 // Increment offset. 103 103 $offset = ( $limit + $offset ); 104 104 105 105 if ( ! empty( $results ) ) { 106 106 foreach ( $results as $r ) { 107 // Explode comment_agent key 107 // Explode comment_agent key. 108 108 list ( $ca_bid, $source_comment_id ) = explode( '-', $r->comment_agent ); 109 109 $source_comment_id = intval( $source_comment_id ); 110 110 111 // Check if this comment came from this blog 111 // Check if this comment came from this blog. 112 112 if ( $bid == $ca_bid ) { 113 113 $hashtable[ $source_comment_id ] = intval( $r->comment_ID ); … … 204 204 */ 205 205 public function get_page( $url, $username = '', $password = '', $head = false ) { 206 // Increase the timeout 206 // Increase the timeout. 207 207 add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) ); 208 208 … … 268 268 // Or define( 'WP_IMPORTING', true ); 269 269 $wpdb->queries = array(); 270 // Reset $wp_actions to keep it from growing out of control 270 // Reset $wp_actions to keep it from growing out of control. 271 271 $wp_actions = array(); 272 272 } … … 318 318 } 319 319 320 // Check array for specified param 320 // Check array for specified param. 321 321 if ( isset( $out[ $param ] ) ) { 322 // Set return value 322 // Set return value. 323 323 $return = $out[ $param ]; 324 324 } 325 325 326 // Check for missing required param 326 // Check for missing required param. 327 327 if ( ! isset( $out[ $param ] ) && $required ) { 328 // Display message and exit 328 // Display message and exit. 329 329 echo "\"$param\" parameter is required but was not specified\n"; 330 330 exit();
Note: See TracChangeset
for help on using the changeset viewer.