Skip to content

Commit 167d134

Browse files
authored
Merge pull request #394 from BeAPI/fix/svg-service-with-acf-svg-icon
fix (theme): svg service compatibility with acf-svg-icon
2 parents cd5a9bd + 8209718 commit 167d134

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

inc/Services/Svg.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public function get_the_icon( string $icon_class, array $additionnal_classes = [
4343
return '';
4444
}
4545

46+
// acf-svg-icon already return sprite-name.svg#icon-name, ex: social.svg#icon-facebook
47+
// format the string to obtain sprite-name/icon-name
48+
$icon_class = str_replace( '.svg#icon-', '/', $icon_class );
49+
4650
$sprite_name = 'icons';
4751

4852
if ( false !== strpos( $icon_class, '/' ) ) {

0 commit comments

Comments
 (0)