Skip to content

Instantly share code, notes, and snippets.

@tallesairan
Last active March 31, 2023 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tallesairan/052fc521a49f840b34f71cddbbd57142 to your computer and use it in GitHub Desktop.
Save tallesairan/052fc521a49f840b34f71cddbbd57142 to your computer and use it in GitHub Desktop.
HrefLang correct language_attributes for global support
<?php
add_filter('language_attributes', function($language_attributes) {
$la = explode('-',$language_attributes);
if(!$la){
return $language_attributes;
}
return $la[0].'"';
} ) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment