Skip to content

Instantly share code, notes, and snippets.

@Pleiades
Created November 15, 2012 20:29
Show Gist options
  • Save Pleiades/4081061 to your computer and use it in GitHub Desktop.
Save Pleiades/4081061 to your computer and use it in GitHub Desktop.
Add a PayPal Donation Link
function donate_shortcode( $atts ) {
extract(shortcode_atts(array(
'text' => 'Make a donation',
'account' => 'REPLACE ME',
'for' => '',
), $atts));
global $post;
if (!$for) $for = str_replace(" ","+",$post->post_title);
return '<a class="donateLink" href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business='.$account.'&item_name=Donation+for+'.$for.'">'.$text.'</a>';
}
add_shortcode('donate', 'donate_shortcode')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment