Created
May 18, 2017 10:16
-
-
Save ideag/99af92dd0d741518d413b8ede8e16db8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
add_filter( 'menu_title', 'arunasco_icons' ); | |
function arunasco_title( $title ) { | |
$title = do_shortcode( $title ); | |
return $title; | |
} | |
// [icon name="fa-coffee"] | |
add_shortcode( 'icon', 'arunasco_icons_shortcode' ); | |
function arunasco_icons_shortcode( $attr=array(), $content = '' ) { | |
$defaults = array( | |
'name' => '', | |
); | |
$attr = wp_parse_args( $attr, $defaults ); | |
$result = "<i class='fa {$attr['name']}'></i>"; | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment