Changeset 741344
- Timestamp:
- 07/15/2013 10:42:05 PM (13 years ago)
- Location:
- readymade-wordpress-importer-061/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wordpress-importer.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
readymade-wordpress-importer-061/trunk/readme.txt
r740762 r741344 5 5 Requires at least: 3.0 6 6 Tested up to: 3.5 7 Stable tag: 0.6. 87 Stable tag: 0.6.9 8 8 9 9 Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file. … … 32 32 33 33 == Changelog == 34 35 = 0.6.9 = 36 * Update post GUIDs post import to reflect currently set domain name, not example.org 37 * Correct URL of plugin on wordpress.org 38 * Fix issues with escaped file names as attachments 34 39 35 40 = 0.6.8 = -
readymade-wordpress-importer-061/trunk/wordpress-importer.php
r740762 r741344 2 2 /* 3 3 Plugin Name: ReadyMade WordPress Importer 4 Plugin URI: http ://wordpress.org/extend/plugins/wordpress-importer/4 Plugin URI: https://wordpress.org/plugins/readymade-wordpress-importer-061/ 5 5 Description: Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file. 6 6 Author: wordpressdotorg, snyderp@gmail.com 7 7 Author URI: http://readymadeweb.com 8 Version: 0.6. 88 Version: 0.6.9 9 9 Text Domain: wordpress-importer 10 10 License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 121 121 $this->backfill_attachment_urls(); 122 122 $this->remap_featured_images(); 123 $this->update_guids(); 123 124 $this->import_end(); 124 125 } … … 920 921 921 922 // get placeholder file in the upload dir with a unique, sanitized filename 922 $upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] ); 923 $unescaped_file_name = urldecode( $file_name ); 924 $upload = wp_upload_bits( $unescaped_file_name, 0, '', $post['upload_date'] ); 923 925 } 924 926 … … 1058 1060 1059 1061 /** 1062 * Update all post guids so that they match the current domain, not the 1063 * example.org domain that the importer uses in the WXR file. 1064 */ 1065 function update_guids() { 1066 1067 global $wpdb; 1068 1069 // If the current site domain ends in a "/", we can just strip it off 1070 // here so we only have to do slightly less work when updating the 1071 // GUIDs in the posts table 1072 $current_site_root = trim( get_option( 'siteurl', 'http://example.org/' ) ); 1073 if ( substr( $current_site_root, -1 ) === '/' ) { 1074 $current_site_root = substr( $current_site_root, 0, -1 ); 1075 } 1076 1077 $query = " 1078 UPDATE 1079 {$wpdb->posts} 1080 SET 1081 guid = REPLACE(guid, %s, %s) 1082 "; 1083 1084 $wpdb->query( $wpdb->prepare( $query, 'http://example.org', $current_site_root ) ); 1085 } 1086 1087 /** 1060 1088 * Parse a WXR file 1061 1089 *
Note: See TracChangeset
for help on using the changeset viewer.