mirror of
https://github.com/10h30/full-screen-morphing-search.git
synced 2026-07-11 10:36:02 +09:00
Added full_screen_morphing_search_add_svg_tags( $svg_tags )
This commit is contained in:
@@ -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',
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user