For the complete documentation index, see llms.txt. This page is also available as Markdown.

weglot_replace_url

This filter allow you to modifiy the replaced url when it is translated.

The filter receives three arguments: the translated URL, the original URL and the target language (a Weglot\Client\Api\LanguageEntry). It must return the URL to use.

add_filter( 'weglot_replace_url', 'custom_weglot_replace_url', 10, 3 );
function custom_weglot_replace_url( $replaced_url, $url, $language ) {
    // Return another URL for a given language if needed.
    return $replaced_url;
}

Last updated