Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.