wp_enqueue_script() WordPress注册js函数

标签:
来源: WordPress 主题、WordPress插件、UZIWP
日期: 2022-8-5
作者: WordPress主题themes插件plugins开发定制
阅读数: 28

介绍

wp_enqueue_script( string $handle, string $src = '', array $deps = array(), string|bool|null $ver = false, bool $in_footer = false )

wp_enqueue_script() 是WordPress注册和引用一个js的函数。

参数

$handle

(string) (必填) js名称,必填,并且不能重复。
$src

(string) (选填) 完整的js链接地址。

Default value: ”
$deps

(array) (选填) 数组,此脚本依赖的注册脚本。

Default value: array()
$ver

(string|bool|null) (Optional) String specifying script version number, if it has one, which is added to the URL as a query string for cache busting purposes. If version is set to false, a version number is automatically added equal to current installed WordPress version. If set to null, no version is added.

Default value: false
$in_footer

(bool) (Optional) Whether to enqueue the script before

链接到文章: https://uziwp.com/11123.html

推荐产品

评论已关闭