• Resolved abindelli

    (@abindelli)


    Hi,

    we are using custom-permalink together with the WPML plugin.
    In our installation wpml is configured to have the language as the query parameter; example: https://www.mysite.com/my-custom-page/?lang=en

    It seems that custom-permalinks is not compatible with this wpml mode
    For example custom-permalinks plugin use the home_url() function in class-custom-permalinks-frontend.php and class-custom-permalinks-form.php assuming that this returns (after be filtered by wpml), an home_url without query params (only wpml configured with language path or domain mode, would work; example: https://www.mysite.com/en/my-custom-page/)

    // not working code from class-custom-permalinks-frontend.php
    $permalink = ltrim(str_replace(home_url(), ”, $ permalink), ‘/’);

    and also more explicitly in the wpml_permalink_filter hook there is a language concatenation:
    $permalink = $site_url. ‘/’. $language_code. ‘/’. $custom_permalink;

    I understand that being compatible with the various features of multilingual plugins (wpml, polylang, etc.) is complex but if you could
    release an hook when you use the home_url function (for example custom_permalinks_home_url) we could redefine the home_url according to the wpml configuration that we are using.

    would it be possible to have this hook in an upcoming release?

    Best
    Alessandro

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi @abindelli

    Sorry for delay in my response. Is it still an issue for you and you are looking for the solution? If yes, so I can add a hook to set home_url as per your site settings.

    Please let me know your thoughts.

    Thanks and Regards,
    Sami

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi @abindelli

    As per not getting any response from you, I am marking this thread as resolved. If you still have this issue then Please feel free to reopen it or create a new issue.

    Thanks & Regards,
    Sami

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WPML (query param language mode) and Custom-permalink compatibility issue’ is closed to new replies.