Last active
November 20, 2016 14:14
-
-
Save jasontucker/dcf1a308716407c394f1be2cf21ae2f5 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
function recent_donors_function() { | |
//Get the latest 100 Give Donors | |
$args = array( | |
'number' => 100, | |
function recent_donors_function() { | |
$donors = Give() - > customers - > get_customers($args); | |
foreach($donors as $donor) { | |
$output. = $names.$donor - > name. | |
", "; | |
// First and Last Name | |
$name = $names.$donor - > name; | |
//Split up the names | |
$separate = explode(" ", $name); | |
//find the surname | |
$last = array_pop($separate); | |
//Shorten up the name so it's Jason T. instead of Jason Tucker | |
$shortenedname = implode(' ', $separate). | |
" ".$last[0]. | |
"."; | |
//Display the Jason T. and include a , after it. | |
$output. = $shortenedname. | |
", "; | |
} | |
$output. = " and many more."; | |
return $output; | |
} | |
} | |
add_shortcode('donor_list', 'recent_donors_function'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment