
WordPress短代码的终极指南
wp_get_duotone_filter_property ( $preset )
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 . "')"; }