wp_kses_uri_attributes

函数
wp_kses_uri_attributes ( No parameters )
返回值
  • (string[]) HTML attribute names whose value contains a URL.
定义位置
相关方法
wp_pre_kses_block_attributeswp_sanitize_script_attributeswp_kses_attrwp_kses_js_entitieswp_kses_one_attr
引入
5.0.1
弃用
-

wp_kses_uri_attributes: 该函数用于对包含URL的HTML属性列表进行净化。

返回一个HTML属性名称的数组,其值包含一个URL。

根据HTML规范,该函数返回一个所有必须包含URL的HTML属性的列表。

这个列表包括KSES允许和不允许的URI属性。

function wp_kses_uri_attributes() {
	$uri_attributes = array(
		'action',
		'archive',
		'background',
		'cite',
		'classid',
		'codebase',
		'data',
		'formaction',
		'href',
		'icon',
		'longdesc',
		'manifest',
		'poster',
		'profile',
		'src',
		'usemap',
		'xmlns',
	);

	/**
	 * Filters the list of attributes that are required to contain a URL.
	 *
	 * Use this filter to add any `data-` attributes that are required to be
	 * validated as a URL.
	 *
	 * @since 5.0.1
	 *
	 * @param string[] $uri_attributes HTML attribute names whose value contains a URL.
	 */
	$uri_attributes = apply_filters( 'wp_kses_uri_attributes', $uri_attributes );

	return $uri_attributes;
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-14 09:36:28

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: