Make WordPress Core


Ignore:
Timestamp:
10/20/2024 01:11:24 PM (7 weeks ago)
Author:
SergeyBiryukov
Message:

Editor: Replace id attribute with class in WP_Font_Face::get_style_element().

wp_print_font_faces() prints an HTML tag that can be used more than once, so the document could end up having multiple tags with the same id attribute.

The id global attribute defines an identifier (ID) which must be unique in the whole document.

Reference: MDN Web Docs: id.

Follow-up to [56500].

Props mmaattiiaass, peterwilsoncc.
Fixes #62246.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/fonts/class-wp-font-face.php

    r58075 r59259  
    230230        $attributes = $this->generate_style_element_attributes();
    231231
    232         return "<style id='wp-fonts-local'{$attributes}>\n%s\n</style>\n";
     232        return "<style class='wp-fonts-local'{$attributes}>\n%s\n</style>\n";
    233233    }
    234234
Note: See TracChangeset for help on using the changeset viewer.