Prevent Removing Backslashes When Duplicate Posts In WordPress With WPML

After installing the WPML WordPress Plugin, we noticed that all backslashes in the duplicate post were disappeared. If you often work with paths in your posts, this is an annoying issue. Even in the latest version 3.1.5 we noticed this problem.

A simple workaround by wrapping a bit of code with the WordPress function addslashes_gpc() fix this issue.

// sitepress-multilingual-cms/inc/translation-management/translation-management.class.php (Line 1060)
...
$post_array[ 'post_content' ] = addslashes_gpc( apply_filters( 'icl_duplicate_generic_string', $master_post->post_content, $lang, array( 'context' => 'post', 'attribute' => 'content', 'key' => $master_post->ID ) ) );
...
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Tags:
wpml