• Resolved FireGhost0610

    (@fireghost0610)


    Hello,

    Nice plugin here ! You have done a really good work !

    But, I have a problem with the “eShop” plugin who use the function “get_permalink” to get some url. This function return automaticaly the default language of an page’s ID … (more here)
    So if I’m on a french page and I clic on a url created with “get_permalink”, I’ll go on an english page, not a french one .. That’s a problem.

    How could I fix this ? Do you have a hack of the “get_permalink” function ?

    Thanks
    (Sorry if my english is bad .. ?? )

    https://www.ads-software.com/plugins/ceceppa-multilingua/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Alessandro Senese

    (@ceceppa)

    Hi,
    sorry for delay…
    I can do same tests… Can you can contact me here: https://www.alessandrosenese.eu/contatti?

    Regards

    Thread Starter FireGhost0610

    (@fireghost0610)

    Hello,

    I got a bit deeper. Now, I just need a function to get the translated page by his default ID.
    For example, if “get_permalink” call an english page ID while the user is on a french page, the function that I need will convert the link to the french ID page (using the WP filter “page_link”).
    Do you already have a function like this or should I code this one ? ??
    (I can use the “wp_ceceppa_ml_posts” table for the translations)

    Thanks

    PS: I contacted you with the link that you gave to me.. Did you recive the mail ?

    Plugin Author Alessandro Senese

    (@ceceppa)

    Hi,
    Sorry, I received the mail, but I forgot to answer :(…
    However try the function:

    cml_get_linked_posts( $post_id );

    It will return an array like:

    Array
    (
    [de] => 153
    [es] => 151
    [it] => 145
    [posts] => 153,151,145
    )

    The argoument of the function is optional, if you pass “null” its value will be the current id of post/page…

    Regads

    PS: Sorry again ??

    Thread Starter FireGhost0610

    (@fireghost0610)

    Hi,

    Thank you for your answers. It helps me a lot and I found a solution to my problem. I used cml_get_linked_post for translating the link I wanted.

    So, thank you !
    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Translate with "get_permalink"’ is closed to new replies.