Changeset 13735
- Timestamp:
- 03/17/2010 04:56:10 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/wordpress.php
r13316 r13735 169 169 // this will populate $this->author_ids with a list of author_names => user_ids 170 170 171 foreach ( $_POST['author_in'] as $i => $in_author_name ) {171 foreach ( (array) $_POST['author_in'] as $i => $in_author_name ) { 172 172 173 173 if ( !empty($_POST['user_select'][$i]) ) { … … 320 320 $catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name', 'category_description'); 321 321 322 print "<em>" . __( "Importing category $cat_name" ) . "</em><br />\n"; 322 323 $cat_ID = wp_insert_category($catarr); 323 324 } … … 341 342 $tagarr = compact('slug', 'description'); 342 343 344 print "<em>" . __( "Importing tag $tag_name" ) . "</em><br />\n"; 343 345 $tag_ID = wp_insert_term($tag_name, 'post_tag', $tagarr); 344 346 } … … 378 380 $termarr = compact('slug', 'description'); 379 381 382 print "<em>" . __( "Importing $term_name" ) . "</em><br />\n"; 380 383 $term_ID = wp_insert_term($term_name, $this->get_tag( $c, 'wp:term_taxonomy' ), $termarr); 381 384 } … … 495 498 } 496 499 else { 497 printf(__('Importing post <em>%s</em>...') , stripslashes($post_title));500 printf(__('Importing post <em>%s</em>...') . "\n", stripslashes($post_title)); 498 501 $comment_post_ID = $post_id = wp_insert_post($postdata); 499 502 if ( $post_id && $is_sticky == 1 ) … … 637 640 } 638 641 642 if ( 0 == filesize( $upload['file'] ) ) { 643 print __( "Zero length file, deleting" ) . "\n"; 644 unlink( $upload['file'] ); 645 return; 646 } 647 639 648 if ( $info = wp_check_filetype($upload['file']) ) { 640 649 $postdata['post_mime_type'] = $info['type']; … … 666 675 } 667 676 668 function fetch_remote_file($post, $url) { 677 function fetch_remote_file( $post, $url ) { 678 add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) ); 679 669 680 $upload = wp_upload_dir($post['post_date']); 670 681 … … 706 717 // keep track of the old and new urls so we can substitute them later 707 718 $this->url_remap[$url] = $upload['url']; 719 $this->url_remap[$post['guid']] = $upload['url']; 708 720 // if the remote url is redirected somewhere else, keep track of the destination too 709 721 if ( $headers['x-final-location'] != $url ) … … 712 724 return $upload; 713 725 726 } 727 728 /** 729 * Bump up the request timeout for http requests 730 * 731 * @param int $val 732 * @return int 733 */ 734 public function bump_request_timeout( $val ) { 735 return 60; 714 736 } 715 737
Note: See TracChangeset
for help on using the changeset viewer.