When I want to import the XML files with the aid of the WordPress Importer plugin, the blogs imported will lose all the slashes, i.e., “\”, which are really contained in the XML files imported.

Since I have to use the LaTeX plug-in (Latex for WordPress plug-in), it becomes terrible.

In fact, maybe weeks ago, it worked well. There was no such problem at all. But from one day, I find that all changed. TT

Is there any one who know what’s happening? Thank you very much!

4 Answers
4

The importer calls wp_insert_post() which runs stripslashes_deep() on the data. But the exporter doesn’t run addslashes. Looks like a bug to me.

What you may try is to prepare the data during export.

Create a plugin with the following content and activate it before you run the export:

<?php
/**
 * Plugin Name: Slash my export
 * Description: Adds extra back slashes to exported data.
 */

add_filter( 'the_content_export', 'addslashes' );
add_filter( 'the_excerpt_export', 'addslashes' );

I have not tested this, it may be wrong, it may have side effects. stripslashes_deep() may eat the extra slashes too …

You should open a bug on Trac if this plugin fixes your problem.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *