Added full_screen_morphing_search_add_svg_tags( $svg_tags )

This commit is contained in:
LebCit
2018-12-12 08:35:34 +02:00
parent 0d8bc50e81
commit f1f47a13c1
+36 -5
View File
@@ -41,6 +41,40 @@ function fsmsp_customize_preview_js() {
}
add_action( 'customize_preview_init', 'fsmsp_customize_preview_js' );
if ( ! function_exists( 'full_screen_morphing_search_add_svg_tags' ) ) {
/**
* Function to add svg tags to wp_kses_allowed_html
*
* @see http://themelovin.com/add-allowed-html-tags-wordpress/
*
* To secure the output, to correctly escape it !
* @see https://wordpress.stackexchange.com/a/316943
*
* @param array $svg_tags The SVG Tags.
*
* @since 2.4
*/
function full_screen_morphing_search_add_svg_tags( $svg_tags ) {
$svg_tags['svg'] = array(
'version' => true,
'id' => true,
'xmlns' => true,
'xmlns:xlink' => true,
'x' => true,
'y' => true,
'viewbox' => true, // <= Must be lower case !
'style' => true,
'xml:space' => true,
);
$svg_tags['path'] = array(
'fill' => true,
'd' => true,
);
return $svg_tags;
}
add_filter( 'wp_kses_allowed_html', 'full_screen_morphing_search_add_svg_tags' );
}
/**
* Require Kirki.
*/
@@ -173,11 +207,8 @@ if ( class_exists( 'Kirki' ) ) {
'transport' => 'auto',
'output' => array(
array(
'element' => array(
'#Layer_1 circle',
'#Layer_1 line',
),
'property' => 'stroke',
'element' => '#Capa_1 path',
'property' => 'fill',
),
),
)