wp_preload_resources

过滤钩子


apply_filters( 'wp_preload_resources', array()
参数
  • (array)
    $preload_resources
    {
    Array of resources and their attributes, or URLs to print for resource preloads.

    @type array …$0 {
    Array of resource attributes.

    @type string $href URL to include in resource preloads. Required.
    @type string $as How the browser should treat the resource
    (`script`, `style`, `image`, `document`, etc).
    @type string $crossorigin Indicates the CORS policy of the specified resource.
    @type string $type Type of the resource (`text/html`, `text/css`, etc).
    @type string $media Accepts media types or media queries. Allows responsive preloading.
    @type string $imagesizes Responsive source size to the source Set.
    @type string $imagesrcset Responsive image sources to the source set.
    }
    }

    Required:
定义位置
  • wp-includes/general-template.php
    , line 3606
引入
6.1.0
弃用

Filters domains and URLs for resource preloads.

$preload_resources = apply_filters( 'wp_preload_resources', array() );
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。