=== modified file 'wp-admin/import/wordpress.php'
|
|
|
551 | 551 | // the filter can return false to skip a particular metadata key |
552 | 552 | $_key = apply_filters('import_post_meta_key', $key); |
553 | 553 | if ( $_key ) { |
554 | | add_post_meta( $post_id, $_key, $value ); |
| 554 | add_post_meta( $post_id, $_key, $value, false, false ); |
555 | 555 | do_action('import_post_meta', $post_id, $_key, $value); |
556 | 556 | } |
557 | 557 | } |
=== modified file 'wp-includes/post.php'
|
|
|
510 | 510 | * @param bool $unique Optional, default is false. Whether the same key should not be added. |
511 | 511 | * @return bool False for failure. True for success. |
512 | 512 | */ |
513 | | function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) { |
| 513 | function add_post_meta($post_id, $meta_key, $meta_value, $unique = false, $serialize = true) { |
514 | 514 | if ( !$meta_key ) |
515 | 515 | return false; |
516 | 516 | |
… |
… |
|
526 | 526 | if ( $unique && $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) |
527 | 527 | return false; |
528 | 528 | |
529 | | $meta_value = maybe_serialize( stripslashes_deep($meta_value) ); |
| 529 | $meta_value = stripslashes_deep($meta_value); |
| 530 | if ($serialize) $meta_value = maybe_serialize($meta_value); |
530 | 531 | |
531 | 532 | $wpdb->insert( $wpdb->postmeta, compact( 'post_id', 'meta_key', 'meta_value' ) ); |
532 | 533 | |