Created
November 15, 2012 20:29
-
-
Save Pleiades/4081061 to your computer and use it in GitHub Desktop.
Add a PayPal Donation Link
This file contains 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 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') |
This file contains 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
[donate] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment