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/tests/phpunit/tests/fonts/font-face/wpFontFace/generateAndPrint.php

    r56500 r59259  
    3232    public function test_should_generate_and_print_given_fonts( array $fonts, $expected ) {
    3333        $font_face       = new WP_Font_Face();
    34         $style_element   = "<style id='wp-fonts-local' type='text/css'>\n%s\n</style>\n";
     34        $style_element   = "<style class='wp-fonts-local' type='text/css'>\n%s\n</style>\n";
    3535        $expected_output = sprintf( $style_element, $expected );
    3636
Note: See TracChangeset for help on using the changeset viewer.