wp-bootstrap-navwalker
wp-bootstrap-navwalker copied to clipboard
It would be really easy to add FontAwesome support!
/*
* Glyphicons
* ===========
* Since the the menu item is NOT a Divider or Header we check the see
* if there is a value in the attr_title property. If the attr_title
* property is NOT null we apply it as the class name for the glyphicon.
*/
if ( ! empty( $item->attr_title ) && strpos($item->attr_title, 'glyphicon-') === 0 ){
$item_output .= '<a'. $attributes .'><span class="glyphicon ' . esc_attr( $item->attr_title ) . '"></span> ';
} elseif ( ! empty( $item->attr_title ) && strpos($item->attr_title, 'fa-') === 0 ) {
$item_output .= '<a'. $attributes .'><span class="fa ' . esc_attr( $item->attr_title ) . '"></span> ';
} else{
$item_output .= '<a'. $attributes .'>';
}
This is coming in the next version of the walker, we are creating a whole icon support structure.