function upgrade_130() { global $wpdb;
// Remove extraneous backslashes.
$posts =
$wpdb->
get_results( "SELECT ID, post_title, post_content, post_excerpt, guid, post_date, post_name, post_status, post_author FROM
$wpdb->posts"
);
if ( $posts ) { foreach ( $posts as $post ) { $post_content =
addslashes( deslash( $post->post_content
) );
$post_title =
addslashes( deslash( $post->post_title
) );
$post_excerpt =
addslashes( deslash( $post->post_excerpt
) );
if ( empty( $post->guid
) ) { $guid =
get_permalink( $post->ID
);
} else { $guid =
$post->guid;
} $wpdb->
update( $wpdb->posts,
compact( 'post_title', 'post_content', 'post_excerpt', 'guid'
), array
( 'ID' =>
$post->ID
) );
} }