Ticket #4472: mtimport.diff
File mtimport.diff, 1.4 KB (added by , 18 years ago) |
---|
-
mt.php
220 220 if ( 0 != count($post->categories) ) { 221 221 wp_create_categories($post->categories, $post_id); 222 222 } 223 224 // Add keywords. No way to add postmeta data with wp_insert_post(), so do it manually. 225 global $wpdb; 226 $table_name = $wpdb->prefix . "postmeta"; 227 $insert = "INSERT INTO " . $table_name . 228 " (post_id, meta_key, meta_value) " . 229 "VALUES ($post_id,'mtkeywords','" . $wpdb->escape($post->keywords) . "')"; 230 $results = $wpdb->query( $insert ); 223 231 } 224 232 225 233 $num_comments = 0; … … 268 276 269 277 $context = ''; 270 278 $post = new StdClass(); 279 $keywords = new StdClass(); 271 280 $comment = new StdClass(); 272 281 $comments = array(); 273 282 $ping = new StdClass(); … … 293 302 $context = ''; 294 303 $this->save_post($post, $comments, $pings); 295 304 $post = new StdClass; 305 $keywords = new StdClass; 296 306 $comment = new StdClass(); 297 307 $ping = new StdClass(); 298 308 $comments = array(); … … 392 402 $post->extended .= $line; 393 403 } else if ( 'excerpt' == $context ) { 394 404 $post->post_excerpt .= $line; 405 } else if ( 'keywords' == $context ) { 406 $post->keywords .= $line; 395 407 } else if ( 'comment' == $context ) { 396 408 $comment->comment_content .= $line; 397 409 } else if ( 'ping' == $context ) {