Make WordPress Core


Ignore:
Timestamp:
03/27/2019 12:15:15 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Themes: Remove itemprop="url" from get_custom_logo() output.

Making incorrect assumptions about microdata used in a theme results in invalid markup.

The attribute can still be added using the get_custom_logo or wp_get_attachment_image_attributes filter, but it should not be added by default.

Props henry.wright, tfrommen, afercia, markcallen, zodiac1978.
Fixes #37305.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/general/template.php

    r44785 r45028  
    309309
    310310                $custom_logo_attr = array(
    311                         'class'    => 'custom-logo',
    312                         'itemprop' => 'logo',
     311                        'class' => 'custom-logo',
    313312                );
    314313
    … …  
    323322                restore_current_blog();
    324323
    325                 $expected_custom_logo = '<a href="' . $home_url . '" class="custom-logo-link" rel="home" itemprop="url">' . $image . '</a>';
     324                $expected_custom_logo = '<a href="' . $home_url . '" class="custom-logo-link" rel="home">' . $image . '</a>';
    326325                $this->assertEquals( $expected_custom_logo, get_custom_logo( $blog_id ) );
    327326        }
    … …  
    339338
    340339                $custom_logo_attr = array(
    341                         'class'    => 'custom-logo',
    342                         'itemprop' => 'logo',
     340                        'class' => 'custom-logo',
    343341                );
    344342
    … …  
    351349                $image = wp_get_attachment_image( $this->custom_logo_id, 'full', false, $custom_logo_attr );
    352350
    353                 $this->expectOutputString( '<a href="http://' . WP_TESTS_DOMAIN . '/" class="custom-logo-link" rel="home" itemprop="url">' . $image . '</a>' );
     351                $this->expectOutputString( '<a href="http://' . WP_TESTS_DOMAIN . '/" class="custom-logo-link" rel="home">' . $image . '</a>' );
    354352                the_custom_logo();
    355353        }
    … …  
    371369                        false,
    372370                        array(
    373                                 'class'    => 'custom-logo',
    374                                 'itemprop' => 'logo',
     371                                'class' => 'custom-logo',
    375372                        )
    376373                );
    377374
    378                 $this->expectOutputString( '<a href="http://' . WP_TESTS_DOMAIN . '/" class="custom-logo-link" rel="home" itemprop="url">' . $image . '</a>' );
     375                $this->expectOutputString( '<a href="http://' . WP_TESTS_DOMAIN . '/" class="custom-logo-link" rel="home">' . $image . '</a>' );
    379376                the_custom_logo();
    380377        }
Note: See TracChangeset for help on using the changeset viewer.