wp_get_duotone_filter_property

函数
wp_get_duotone_filter_property ( $preset )
Access
Private
参数
  • (array) $preset Duotone preset value as seen in theme.json.
    Required:
返回值
  • (string) Duotone CSS filter property url value.
定义位置
相关方法
wp_get_duotone_filter_idwp_get_duotone_filter_svgwp_render_duotone_filter_presetwp_get_theme_errorwp_get_pomo_file_data
引入
5.9.0
弃用
-

wp_get_duotone_filter_property: 这个函数返回用于对图片进行双色过滤的CSS属性。它通常用于为前端的图像设置样式。

返回CSS过滤器属性的网址,以引用渲染的SVG。

function wp_get_duotone_filter_property( $preset ) {
	if ( isset( $preset['colors'] ) && 'unset' === $preset['colors'] ) {
		return 'none';
	}
	$filter_id = wp_get_duotone_filter_id( $preset );
	return "url('#" . $filter_id . "')";
}

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-05 15:32:55

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

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

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