Skip to content

Instantly share code, notes, and snippets.

@tracyfloyd
Last active August 28, 2018 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tracyfloyd/72b2d991651aeb082783b32ae3dde342 to your computer and use it in GitHub Desktop.
Save tracyfloyd/72b2d991651aeb082783b32ae3dde342 to your computer and use it in GitHub Desktop.
Better Font Awesome - Fix for get_icon_array_version_5() error
<?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