I am scanning a WP Plugin with SonarCloud and it flagged the usage of
<?php language_attributes(); ?> in
html tag as
Add "lang" and/or "xml:lang" attributes to this "<html>" element
This is a false positive, since WordPress will indeed add the HTML language attribute thru the function
<?php language_attributes(); ?>
How do I update my SonarCloud instance so that in this and future projects, said function is recognised as a valid HTML lang attribute?
I would prefer to not just “mark as false positive” or “ignore” instead set a proper rule, that takes care of this
Same goes for the
title tag, which in WP we produce with a special support statement in the code (it does not even appear in the actual HTML head, it will appear elsewhere, for example, in a theme’s functions php file, or so.