WordPress / theme-check

Theme Check plugin
https://wordpress.org/plugins/theme-check/
341 stars 114 forks source link

add_theme_support checks are fragile due to whitespace #411

Closed siliconforks closed 2 years ago

siliconforks commented 2 years ago

If I run a theme check on the Twenty Twenty-One theme, I get messages like these:

RECOMMENDED: No reference to add_theme_support( "html5", $args ) was found in the theme. It is strongly recommended that the theme implement this functionality.
RECOMMENDED: No reference to add_theme_support( "custom-logo", $args ) was found in the theme. It is recommended that the theme implement this functionality.

However, the theme does in fact have code for supporting these features.

I think the problem is that Twenty Twenty-One's code is formatted in a rather elaborate way:

add_theme_support(
    'html5',
    array(
        'comment-form',
        'comment-list',
        'gallery',
        'caption',
        'style',
        'script',
        'navigation-widgets',
    )
);