Title: [Plugin: WordPress Multi Language] compatibility with Post Type Switcher
Last modified: August 20, 2016

---

# [Plugin: WordPress Multi Language] compatibility with Post Type Switcher

 *  [jan444](https://wordpress.org/support/users/jan444/)
 * (@jan444)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-wordpress-multi-language-compatibility-with-post-type-switcher/)
 * Hello guys,
 * I’m trying to make two plugins work together: WP Multi Language and Post Type
   Switcher.
 * Once installed, as soon as I switch a post type into another, it will disappear
   from the admin area.
 * I did some research and found some people who already had this issue, but it’s
   a closed thread and it’s unclear to me what to do next.
 * – [http://wordpress.org/support/topic/post-type-switcher-bug-with-wpml?replies=5](http://wordpress.org/support/topic/post-type-switcher-bug-with-wpml?replies=5)
 * It appears that Post Type Switcher would need to update the WPML database to 
   take into account the switch. I tried to paste the recomended code at the end
   of `post-type-switcher.php`, but it throws an error about the `update` method.
 * Here’s the code:
 *     ```
       // in case of using the WPML plugin
       if(function_exists('icl_object_id')){
       // adjust field 'element_type' in table 'wp_icl_translations'
       // from 'post_OLDNAME' to 'post_NEWNAME'
       // the post_id you look for is in column: 'element_id'
   
       if($post->post_type == 'revision'){
       if(is_array($post->ancestors)){
       $ID = $post->ancestors[0];
       }
       }else{
       $ID = $post->ID;
       }
   
       $wpdb->update("{$wpdb->prefix}icl_translations", array('element_type' => 'post_' . $new_post_type_object->name), array('element_id' => $ID));
       }
       ```
   
 * Would you know guys of a way to correctly interpret and place that code?
 * Cheers,

The topic ‘[Plugin: WordPress Multi Language] compatibility with Post Type Switcher’
is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [jan444](https://wordpress.org/support/users/jan444/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-wordpress-multi-language-compatibility-with-post-type-switcher/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
