Created
February 8, 2015 17:12
-
-
Save Rubel-hossain/5789ff023fee863d8d71 to your computer and use it in GitHub Desktop.
Ideal Shortcode example
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 | |
function button_shortcode($atts,$content){ | |
extract($atts=shortcode_atts(array( | |
'type'=>!empty($type) ? $type:'success', | |
'link'=>'http://www.m.facebook.com', | |
'icon'=> empty($icon) ? 'heart': $icon , | |
'content'=> !empty($content) ? $content : 'empty content here' | |
),$atts,'btn')); | |
return '<a href="'.$link.'" class="btn btn-'.$type.'"><i class="fa fa-'.$icon.' "></i> '.$content.' </a>'; | |
} | |
add_shortcode('btn','button_shortcode'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment