wp_get_script_tag
函数
wp_get_script_tag ( $attributes )
- 参数
-
-
(array)
$attributes
Key-value pairs representing `
-
(array)
- 返回值
-
- (string) String containing `
- 定义位置
-
-
wp-includes/script-loader.php
, line 2733
-
wp-includes/script-loader.php
- 引入
- 5.7.0
- 弃用
- –
Formats `
It is possible to inject attributes in the “ tag via the {@see ‘wp_script_attributes’} filter.
Automatically injects type attribute if needed.
function wp_get_script_tag( $attributes ) { if ( ! isset( $attributes['type'] ) && ! is_admin() && ! current_theme_supports( 'html5', 'script' ) ) { $attributes['type'] = 'text/javascript'; } /** * Filters attributes to be added to a script tag. * * @since 5.7.0 * * @param array $attributes Key-value pairs representing `n", wp_sanitize_script_attributes( $attributes ) ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。