WordPress.org

Ready to get started?Download WordPress

Forums

Paypal Donation Shortcode
Donation Shortcode With Post Title In Donation Link (1 post)

  1. Amber
    Member
    Posted 1 year ago #

    Hi Coen,

    Thanks for this handy little shortcode! Works like a charm.

    I made a small modification to the plugin to get it working with post titles in the donate link and thought I would share it. :)

    In the paypal-donation-shortcode.php file I changed:

    "title" => 'Donation'

    to

    "title" => ' '

    I then added the following 2 lines above $content = "";

    global $post;
    
    if (!$title) $title = str_replace(" ","+",$post->post_title);

    When I use the shortcode I simply don't include title attribute and it inserts my post title.

    So, instead of shortcode example:

    [paypal text="Do you like this plugin? Please reward it with a little donation." email="paypal@coenjacobs.net" title="Donation for Paypal Donation Shortcode plugin" currency="USD"/]

    use something like (without title attribute):

    [paypal text="Do you like this plugin? Please reward it with a little donation." email="paypal@coenjacobs.net" currency="USD"/]

    (This won't effect users who want to continue to set their title using the title attribute, it's only for when the title attribute is not used).

    http://wordpress.org/extend/plugins/paypal-donation-shortcode/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.