WordPress.org

Forums

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

  1. Bart De Vuyst
    Member
    Posted 11 months 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 1 month 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
    Member
    Plugin Author

    Posted 1 month 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 1 month 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 );

Reply

You must log in to post.

About this Plugin

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

About this Topic