WordPress.org

Support

Support » Plugins and Hacks » Paypal Donation Shortcode » Donation Shortcode With Post Title In Donation Link

Donation Shortcode With Post Title In Donation Link

  • 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/

  • The topic ‘Donation Shortcode With Post Title In Donation Link’ is closed to new replies.
Skip to toolbar