• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Tips and Tricks HQ

  • Home
  • Projects
    • All Projects
    • Simple WP Shopping Cart
    • WP Express Checkout Plugin
    • Accept Stripe Payments
    • WP Download Monitor
    • Easy HTTPS Redirection
    • WP Security and Firewall Plugin
    • WP eStore Plugin
    • WP Affiliate Platform
    • WP eMember
  • Products
    • All Products
    • Checkout
  • Support
    • Support Portal
    • Customer Only Forum
    • WP eStore Documentation
    • WP Affiliate Software Documentation
    • WP eMember Documentation
  • Contact

Create PayPal Payment Button for The Post Author Automatically

Home » Blog » Create PayPal Payment Button for The Post Author Automatically

Last updated: June 13, 2014 by Ruhul Amin





I received the following question from a user today:

When users create a charity on my site, I want to have a donate button on their post that automatically gets the proper email address to use for the PayPal transaction. This way I don’t have to manually add their email to the shortcode for every charity that is created on my site.

This is a quick tutorial for users who want to create a PayPal payment button widget in the blog posts using the author’s PayPal email address. This way the payment or donation directly goes to the post author’s PayPal account. Here is how to do it:

Step 1

Grab the free WP PayPal Payment Plugin and install it (if you don’t have it installed already). This plugin lets you crate payment widgets to accept PayPal payment.



Step 2

Open your theme’s functions.php file and add the following snippet of code:

add_filter('wppp_widget_email', 'custom_payment_widget_email');
function custom_payment_widget_email($email){
$email = get_the_author_meta('user_email');
return $email;
}

add_filter('wppp_widget_any_amt_email', 'custom_payment_any_amt_widget_email');
function custom_payment_any_amt_widget_email($email){
$email = get_the_author_meta('user_email');
return $email;
}

The above code will override the PayPal email address value of the payment widget with the post author’s email address automatically.

Step 3

Now, you can use the shortcodes offered by the PayPal payment widget plugin to place a payment widget anywhere inside the WordPress post or you can add the widget from your theme’s template file.

Below is an example of what you could add in your theme’s template file to create the payment widget (the “email” parameter will be auto populated when the page renders):

<?php echo do_shortcode('[wp_paypal_payment_box email="" options="Payment 1:15.50|Payment 2:30.00|Payment 3:50.00"]'); ?>

Note: You can also add custom author meta to store the user’s PayPal email address then modify the code in step 2 to use that value (instead of the default email address value).

Related Posts

  • WP Donations Plugin – Create a Donation Widget with Donation Goal
  • WordPress Easy Paypal Payment or Donation Accept Plugin
  • WordPress Simple Paypal Donation Plugin
  • How to Install WordPress Multi-Site in Localhost (Using XAMPP)

Web Development,  Wordpress accept paypal payment,  Paypal,  paypal donation,  wordpress paypal

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured & Popular Articles

Video Answers to Top WordPress QuestionsWordPress Optimization Tips and Tricks for Better Performance and SpeedEssential WordPress Security Tips - Is Your Blog Protected?WordPress Simple PayPal Shopping Cart PluginTop 15 Search Engine Optimization (SEO) Techniques I Forget to DoList of the Best and Must Use WordPress PluginsHow do I Start a Blog and Make Money Online?Good Domain Name Picking Tips for Your Blog SetupFind Out Which WordPress Web Hosting Company Offers the Cheapest and Reliable Web Hosting Solution

Featured WordPress Plugins

WP Express Checkout Plugin
wordpress estore plugin
wordpress membership plugin
wordpress affiliate plugin

Recent Posts

  • How to Use Browser Developer Tools to Inspect Elements and [...]
  • Accept Donations via PayPal from Your WordPress Site Easil [...]
  • Buy Now Button Graphics for eCommerce Websites [...]
  • Subscription Button Graphics for eCommerce Websites [...]
  • Adding PayPal Payment Buttons to Your WordPress Sidebar Ea [...]

Comment & Socialize

  • @Rob, We have just released ...
    - admin
  • I installed the plugin a co ...
    - Rob
  • @Sebastian, We've released ...
    - admin
  • I've used this plugin on a ...
    - Sebastian Djupsjöbacka
  • @John, this plugin doesn't ...
    - admin

Check out our solutions

View our WordPress plugin collection and start using them on your site.

Our WordPress Solutions

Footer

Company

  • About
  • Privacy Policy
  • Terms and Conditions
  • Affiliate Login

Top WordPress Plugins

  • Simple Shopping Cart
  • PayPal Donations
  • WP Express Checkout
  • WP eStore
  • WP eMember

Blogging Tips

  • How to Start a Blog
  • Selecting a Good Domain
  • Cheap WP Hosting
  • WP Video Tutorials
  • Simple SEO Tips

Search


Keep In Touch

Copyright © 2025 | Tips and Tricks HQ