Make WordPress Core

Ticket #58510: 58510.diff

File 58510.diff, 2.4 KB (added by nihar007, 15 months ago)

I added the fetchpriority attribute

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

    diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php
    index 39c2c84c0a..67535769e0 100644
    a b function wp_preload_resources() { 
    35873587         *     @type array ...$0 {
    35883588         *         Array of resource attributes.
    35893589         *
    3590          *         @type string $href        URL to include in resource preloads. Required.
    3591          *         @type string $as          How the browser should treat the resource
    3592          *                                   (`script`, `style`, `image`, `document`, etc).
    3593          *         @type string $crossorigin Indicates the CORS policy of the specified resource.
    3594          *         @type string $type        Type of the resource (`text/html`, `text/css`, etc).
    3595          *         @type string $media       Accepts media types or media queries. Allows responsive preloading.
    3596          *         @type string $imagesizes  Responsive source size to the source Set.
    3597          *         @type string $imagesrcset Responsive image sources to the source set.
     3590         *         @type string $href            URL to include in resource preloads. Required.
     3591         *         @type string $as              How the browser should treat the resource
     3592         *                                       (`script`, `style`, `image`, `document`, etc).
     3593         *         @type string $crossorigin     Indicates the CORS policy of the specified resource.
     3594         *         @type string $type            Type of the resource (`text/html`, `text/css`, etc).
     3595         *         @type string $media           Accepts media types or media queries. Allows responsive preloading.
     3596         *         @type string $imagesizes      Responsive source size to the source Set.
     3597         *         @type string $imagesrcset     Responsive image sources to the source set.
     3598         *         @type string $fetchpriority   To specify the priority for resource types
     3599         *                                                                               such as CSS, fonts, scripts, and images
    35983600         *     }
    35993601         * }
    36003602         */
    function wp_preload_resources() { 
    36423644                        }
    36433645
    36443646                        // Ignore non-supported attributes.
    3645                         $non_supported_attributes = array( 'as', 'crossorigin', 'href', 'imagesrcset', 'imagesizes', 'type', 'media' );
     3647                        $non_supported_attributes = array( 'as', 'crossorigin', 'href', 'imagesrcset', 'imagesizes', 'type', 'media', 'fetchpriority' );
    36463648                        if ( ! in_array( $resource_key, $non_supported_attributes, true ) && ! is_numeric( $resource_key ) ) {
    36473649                                continue;
    36483650                        }