Created
October 21, 2013 23:57
-
-
Save davidkryzaniak/7092968 to your computer and use it in GitHub Desktop.
Web920 Shortcodes
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 | |
/** | |
* Plugin Name: Web920 Shortcode Example | |
* Description: This is an example plugin | |
* Version: 1.0 | |
* Author: David Kryzaniak | |
* Author URI: http://dave.kz | |
*/ | |
add_shortcode( | |
'getusers', | |
'get_site_users' | |
); | |
function get_site_users($attributes,$content = ''){ | |
$values = shortcode_atts( | |
array('color'=>'#666','fontstyle'=>'normal'), | |
$attributes | |
); | |
$users_list = get_users(); | |
if(!empty($content)){ | |
echo '<h3>'.$content.'</h3>'; | |
} | |
echo '<ol style="color:' . $values['color'] . ';font-style:' | |
. $values['fontstyle'] . ';">'; | |
foreach($users_list as $single_user){ | |
echo '<li>'.$single_user->display_name.'</li>'; | |
} | |
echo '</ol>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment