• I’m getting the following type of Validation warning on a few buttons

    [WARNING] Line 594:18 - <button> is missing recommended "type" attribute (no-implicit-button-type) 

    This is the button in that line:

    <button data-nav="site-navigation" class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">

    Is this something for the folks at GeneratePress to fix in the theme? I realize I could make a child theme and maybe fix these, but it would be better to have them fixed in the theme itself.

    Or am I misunderstanding something? I used this validation tool: https://validatehtml.com/validate-html5

    I’m using GeneratePress Version: 3.6.1

Viewing 1 replies (of 1 total)
  • George

    (@quantum_leap)

    Hello,

    You can use this filter to fix the issue.

    add_filter( 'generate_parse_attr', function( $attributes, $context ) {
    if ( 'menu-toggle' === $context ) {
    $attributes['type'] = 'button';
    }
    return $attributes;
    }, 10, 2 );

    I will also flag it for our devs to have a look!

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.