WordPress.org

Forums

Custom Post Type Permalinks
Not compatible with WPML (WordPress Multilanguage (4 posts)

  1. Bart De Vuyst
    Member
    Posted 1 year ago #

    Hi,

    I like your plugin but I noticed it's NOT compatible with WPML.

    Are you planning to fix this?

    WPML allows you to translate custom post type and also their slugs... Your plugin doesn't recognise the translated slugs...

    Bart

    https://wordpress.org/plugins/custom-post-type-permalinks/

  2. k8n
    Member
    Posted 5 months ago #

    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.

  3. Toro_Unit (Hiroshi Urabe)
    Member
    Plugin Author

    Posted 5 months ago #

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

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

  4. Radovan
    Member
    Posted 5 months ago #

    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 );

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Post Type Permalinks
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic