themeplate/resource
Composer 安装命令:
composer require themeplate/resource
包简介
ThemePlate resource hinting
README 文档
README
Usage
use ThemePlate\Resource; add_action( 'wp_head', array( Resource::class, 'action' ), 2 ); Resource::hint( 'dns-prefetch', '//cdnjs.cloudflare.com' ); Resource::hint( 'preconnect', '//ajax.cloudflare.com' ); Resource::hint( 'prerender', 'http://my.site/blog' ); Resource::hint( 'prefetch', 'jquery-migrate' ); Resource::hint( 'preload', 'jquery-core' ); Resource::hint( 'preload', array( 'href' => 'https://fonts.gstatic.com/s/montserrat/v14/JTURjIg1_i6t8kCHKm45_cJD3gTD_u50.woff2', 'as' => 'font', 'type' => 'font/woff2', ) );
Resource::hint( $directive, $resource )
- $directive (string)(Required) Type of directive to use
- $resource (mixed)(Required)
- URL (string)
dns-prefetchpreconnectprerender- Handle (string)
prefetchpreload- Custom (array)
prefetchpreload
统计信息
- 总下载量: 183
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2020-09-26