wp_get_duotone_filter_id

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

wp_get_duotone_filter_id: 这个函数返回用于在图像上产生双色调效果的SVG过滤器的ID。它与wp_get_duotone_filter_svg一起使用,以生成SVG过滤器。

返回duotone过滤器的前缀id,作为CSS id使用。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_get_duotone_filter_id( $preset ) {
if ( ! isset( $preset['slug'] ) ) {
return '';
}
return 'wp-duotone-' . $preset['slug'];
}
function wp_get_duotone_filter_id( $preset ) { if ( ! isset( $preset['slug'] ) ) { return ''; } return 'wp-duotone-' . $preset['slug']; }
function wp_get_duotone_filter_id( $preset ) {
	if ( ! isset( $preset['slug'] ) ) {
		return '';
	}

	return 'wp-duotone-' . $preset['slug'];
}

常见问题

FAQs
查看更多 >