Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasontucker/dcf1a308716407c394f1be2cf21ae2f5 to your computer and use it in GitHub Desktop.
Save jasontucker/dcf1a308716407c394f1be2cf21ae2f5 to your computer and use it in GitHub Desktop.
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