Skip to content

Commit 050cc7b

Browse files
authored
Merge pull request #329 from BeAPI/feature/svg-markup-update
feat (Svg): replace xlink:href attribute of SVG with href attribute
2 parents a6d15eb + 7016f55 commit 050cc7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

inc/Services/Svg.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function get_the_icon( string $icon_class, array $additionnal_classes = [
5555
$classes = array_merge( $classes, $additionnal_classes );
5656
$classes = array_map( 'sanitize_html_class', $classes );
5757

58-
return sprintf( '<svg class="%s" aria-hidden="true" focusable="false"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="%s#%s"></use></svg>', implode( ' ', $classes ), \get_theme_file_uri( sprintf( '/dist/icons/%s.svg', $sprite_name ) ), $icon_slug ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
58+
return sprintf( '<svg class="%s" aria-hidden="true" focusable="false"><use href="%s#%s"></use></svg>', implode( ' ', $classes ), \get_theme_file_uri( sprintf( '/dist/icons/%s.svg', $sprite_name ) ), $icon_slug ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
5959
}
6060

6161
/**

0 commit comments

Comments
 (0)