Last active
August 28, 2018 13:03
-
-
Save tracyfloyd/72b2d991651aeb082783b32ae3dde342 to your computer and use it in GitHub Desktop.
Better Font Awesome - Fix for get_icon_array_version_5() error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
private function get_icon_array_version_5() { | |
$icons_metadata = $this->get_icons_metadata(); | |
$icons = array(); | |
// Add style prefixes. | |
foreach ( $icons_metadata as $slug => $metadata ) { | |
if ( !empty($metadata['search']['terms']) ) { | |
$search_terms = array_map( function( $term ) { | |
return $term; | |
}, $metadata['search']['terms'] ); | |
} | |
foreach ( $metadata['styles'] as $style ) { | |
$icons[] = array( | |
'title' => "{$metadata['label']} ({$style})", | |
'slug' => $slug, | |
'style' => $style, | |
'base_class' => $this->get_icon_base_class( $slug, $style ), | |
'searchTerms' => $search_terms, | |
); | |
} | |
} | |
return $icons; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment