I need to set it by the technical task.
I’ve found only
function hrefs_to_uppercase($hrefs) {
$hrefs = array_change_key_case($hrefs,CASE_UPPER);
return $hrefs;
}
add_filter( 'wpml_hreflangs', 'hrefs_to_uppercase' );
But it makes all characters uppercase – "EN-AE".
Tried manually in wpml settings- didn’t help
2
Answers
I solved like that for now, maybe right-maybe not
You can simply replace the array key with the following code:
if you want to make every array key have an uppercase second part (e.g. from
en-us
toen-US
), you can use the codes below (assumed all your keys have a similar structure likeen-us
):