Support » Plugins » [Plugin: WordPress Multi Language] compatibility with Post Type Switcher

  • jan444


    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.

    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
    // 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'){
    $ID = $post->ancestors[0];
    $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?


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