Created
January 30, 2013 17:32
-
-
Save claudiosanches/4674943 to your computer and use it in GitHub Desktop.
WordPress Shortcode Skills
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 | |
function cs_skills( $atts ) { | |
extract( shortcode_atts( array( | |
'name' => '', | |
'perc' => '', | |
), $atts ) ); | |
// Arredonda o valor. de 66 vai para 70. | |
$perc = round( $perc, -1 ); | |
$html = '<div class="skills">'; | |
$html .= '<span class="name">' . $name . '</span>'; | |
$html .= '<span class="perc">' . $perc . '%</span>'; | |
$html .= '</div>'; | |
return $html; | |
} | |
add_shortcode( 'skill', 'cs_skills' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment