Support » Plugin: Custom Post Type Permalinks » Not compatible with WPML (WordPress Multilanguage

Viewing 3 replies - 1 through 3 (of 3 total)
  • It seems to be a matter of changing filter priorities. CPTP_Module_Permalink::add_hook … set filter priorities to 0, as WPML sets its to 1.

    I think that it is not good to set priorities to 0.

    So, I’m going to add functionality that can override the settings.

    Hi,

    this is quick fix for custom post type slug:

    in file CPTP/Module/Permalink.php
    on line about 49 replace this:

    $permalink = str_replace( '%'.$post_type.'_slug%', get_post_type_object( $post_type )->rewrite['slug'], $permalink );

    with this:

    $permalink = str_replace( '%'.$post_type.'_slug%', WPML_Slug_Translation::get_translated_slug(get_post_type_object( $post_type )->rewrite['slug'], ICL_LANGUAGE_CODE), $permalink );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Not compatible with WPML (WordPress Multilanguage’ is closed to new replies.