Make WordPress Core

Ticket #50933: 50933.1.diff

File 50933.1.diff, 986 bytes (added by audrasjb, 4 years ago)

Media: Use false value for loading attribute to disable lazy loading by default on get_custom_logo()

  • src/wp-includes/general-template.php

    diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php
    index 378e37fe3d..152832a18e 100644
    a b function has_custom_logo( $blog_id = 0 ) { 
    10001000 *
    10011001 * @since 4.5.0
    10021002 * @since 5.5.0 Added option to remove the link on the home page with `unlink-homepage-logo` theme support.
     1003 * @since 5.5.1 Added false value for loading attribute to disable lazy loading by default.
    10031004 *
    10041005 * @param int $blog_id Optional. ID of the blog in question. Default is the ID of the current blog.
    10051006 * @return string Custom logo markup.
    function get_custom_logo( $blog_id = 0 ) { 
    10181019        // We have a logo. Logo is go.
    10191020        if ( $custom_logo_id ) {
    10201021                $custom_logo_attr = array(
    1021                         'class' => 'custom-logo',
     1022                        'class'   => 'custom-logo',
     1023                        'loading' => false,
    10221024                );
    10231025
    10241026                $unlink_homepage_logo = (bool) get_theme_support( 'custom-logo', 'unlink-homepage-logo' );