Missing bootstrap icons
-
Hello,
i’ve noticed not all the bootstrap icons are available (for example fa-hotel).
When i checked the file helpers.php i found that you are using regex (line 240) to get the classes, but that regex didn’t match all the classes, especially those like
.fa-hotel:before,
.fa-bed:before {
content: “\f236″;
}
So i modified the regex & the code a little bit to solve the problem & here’s the code//old pattern
//$pattern = ‘/\.(fa-(?:\w+(?:-)?)+):before\s+{\s*content:\s*”(.+)”;\s+}/’;//by chouaki tarek
$pattern = ‘/(\.(?:fa-(?:\w+(?:-)?)+):before(?:,\s*\.(?:fa-(?:\w+(?:-)?)+):before)*)\s*{\s*content:\s*”(.+)”;\s*}/’;
$sub_pattern = ‘/(fa-.+?):before/’;
preg_match_all( $pattern, $response[‘body’], $matches, PREG_SET_ORDER );$icons = array();
foreach ( $matches as $match )
{
preg_match_all($sub_pattern, $match[1], $sub_matches, PREG_SET_ORDER);
foreach($sub_matches as $sub_match)
{
$icons[ str_replace( ‘fa-‘, ”, $sub_match[1] ) ] = $match[2];
}
}
The topic ‘Missing bootstrap icons’ is closed to new replies.