With debug_url=1
Array
(
[uri_parts] => Array
(
[lang] =>
[uri] => en-us/products/myproductpage
[endpoint] =>
[endpoint_value] =>
)
[old_query_vars] => Array
(
[attachment] => myproductpage
)
[new_query_vars] => Array
(
[attachment] => myproductpage
)
[pm_query] => -
[content_type] => -
[version] => 2.4.3.4
)
informations on pm_query and content_type are empty
Hi @floadrmd,
Please accept my apology for late response and inconvenience. According to the debug data, it seems like the language code is not properly parsed from the request URL. As of now, Permalink Manager is compatible only with WPML & Polylang plugins and no other language plugin is officially supported.
Could you try to manually overwrite the extracted URI parts using below code snippet?
function pm_remove_language_code( $uri_pats ) {
// Check if 'en-us' exists in the URI
if ( strpos( $uri_pats['uri'], 'en-us' ) !== false ) {
// Replace 'en-us' with an empty string
$uri_pats['uri'] = str_replace( 'en-us/', '', $uri_pats['uri'] );
}
return $uri_pats;
}
add_filter('permalink_manager_detect_uri', 'pm_remove_language_code');
Best regards,
Maciej
Hi Maciej,
Thank you very much for your reply and support.
The override works perfectly now. I don’t use any translation plugins; the en-us code is simply a subdirectory containing the WP installation.
Best regards,