Skip to content

Instantly share code, notes, and snippets.

@darrenmeehan
Created August 5, 2012 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenmeehan/3266387 to your computer and use it in GitHub Desktop.
Save darrenmeehan/3266387 to your computer and use it in GitHub Desktop.
This is a simple WordPress shortcode to add a Paypal button
<?php
/*
Plugin Name: PayPal Shortcode by Darren
Plugin URI: https://gist.github.com/3266387
Description: This is a simple shortcode to add a Paypal button, just use [paypal] as the shortcode.
Version: 0.1
Author:
Author URI:
License:
License URI:
*/
function dm_paypal_function () {
$productid = get_the_title();
$price = get_post_custom_values('item_price');
echo print_wp_cart_button_for_product("$productid", "$price[0]");
}
add_shortcode('paypal', 'dm_paypal_function');
@darrenmeehan
Copy link
Author

Thanks for the help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment