WordPress.org

Ready to get started?Download WordPress

Forums

PayPal Donations
[resolved] Add Drop Down Menu to Widget (2 posts)

  1. thall1908
    Member
    Posted 2 years ago #

    Hi,

    I would like to set up predefined purposes in a drop down menu on the widget. Is this possible?

    Thank you,
    thall1908

    http://wordpress.org/extend/plugins/paypal-donations/

  2. Johan Steen
    Member
    Plugin Author

    Posted 2 years ago #

    @thall1908:

    Adding a drop down menu to the widget is a bit too special functionality to include in the plugin by default imho. But what I did, was that I added a filter for the purpose in the latest update of the plugin (version 1.6).

    With the filter it's simple to add such a functionality yourself, which will survive plugin updates.

    Here's a piece of code you can add to your functions.php for your theme to get you started.

    function paypal_purpose( $purpose ) {
      return '
        <select name="item_name">
          <option value="Donation Purpose 1">Donation Purpose 1</option>
          <option value="Donation Purpose 2">Donation Purpose 2</option>
        </select>
      ';
    }
    add_filter( 'paypal_donations_purpose_html', 'paypal_purpose' );

    Cheers,
    Johan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic