Skip to content

Instantly share code, notes, and snippets.

@davidkryzaniak
Created October 21, 2013 23:57
Show Gist options
  • Save davidkryzaniak/7092968 to your computer and use it in GitHub Desktop.
Save davidkryzaniak/7092968 to your computer and use it in GitHub Desktop.
Web920 Shortcodes
<?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