Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @rstrah,

    Could you try to manually update the plugin to the development version using the below URL:
    https://downloads.wordpress.org/plugin/permalink-manager.zip

    and then uncheck “Edit permalinks in WPML’s Translation Editor” option in the plugin settings?

    This should allow Permalink Manager to automatically generate the custom permalinks for new translations.

    Thread Starter rstrah

    (@rstrah)

    Hi @mbis
    I only need to copy the url from the original, I don’t need the ability to edit this field.
    It doesn’t work very well yet (I updated to dev plugin)

    Plugin Author Maciej Bis

    (@mbis)

    Hi @rstrah,

    Ok, thank you for clarifying it. The plugin does not use custom fields to store the URLs, as it stores them separately in wp_options table. If you would like to copy the URL of the original post after the translation is completed, please use this simple code snippet:

    function pm_copy_original_uri_when_translation_completed( $new_post_id, $fields, $job ) {
    if ( ! is_object( $job ) || empty( $job->original_doc_id ) || ! class_exists( 'Permalink_Manager_URI_Functions_Post' ) ) {
    return;
    }

    // Get current custom permalink of original post
    $original_post_uri = Permalink_Manager_URI_Functions_Post::get_post_uri( $job->original_doc_id );

    if ( empty( $custom_uri ) ) {
    Permalink_Manager_URI_Functions::save_single_uri( $new_post_id, $original_post_uri, false, true );
    }
    }
    add_action( 'wpml_pro_translation_completed', 'pm_copy_original_uri_when_translation_completed', 100, 3 );
    Thread Starter rstrah

    (@rstrah)

    Hi @mbis

    It seems that it does not work very well for me. Although in wpml it is worth not translating the url, it still translates it (the slug itself) and the translation is also fixed in the permalink field

    Plugin Author Maciej Bis

    (@mbis)

    Hi @rstrah,

    As of now there is no way to make WPML ignore and not translate non-standard fields displayed in the Advanced Translation Editor 🙁

    For this reason, the code I sent simply forces Permalink Manager to ignore the text displayed in the “Custom Permalink” field and instead it copies the permalink of the original post.

    If this is not what you meant, please send me the screenshot of the WPML Translation Editor & the actual URL used for the translated post (also let me know how exactly should it look like).

    Thread Starter rstrah

    (@rstrah)

    Plugin Author Maciej Bis

    (@mbis)

    Based on you current settings, the slug should be copied from the original post also when Permalink Manager is deactivated. All the settings displayed in WPML dashboard affect only the native slugs used in the original permalinks.

    Therefore, if the native slug is not copied correctly by WPML, it will not be copied to the custom permalink controlled by Permalink Manager either.

    You need to make sure that this function works as intended if Permalink Manager is not active (so the native slug is copied if translated one is expected to be Russian and include encoded characters).

    Could you temp. deactivate it, translate any new post and send me one more screenshot showing how its slug and full URL look like when Permalink Manager is disabled.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Problem with wpml+permalink lite’ is closed to new replies.