This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Send custom fields from WordPress to AWeber through the PMPro AWeber addon. | |
Your fields must be created already in AWeber and also stored as user meta for the users. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function my_pmpro_aweber_custom_fields($fields, $user) | |
{ | |
if( !empty( $_REQUEST["phone"] ) ){ | |
$fields['phone'] = $_REQUEST["phone"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Give members of level 1 or 2 Free Shipping when free shipping is available (must set free shipping as an option in store settings). | |
* Change $pmprowc_free_shipping_levels = array(1,2); to include level IDs that receive free shipping | |
*/ | |
function my_pmprowc_free_shipping( $rates, $package ) { | |
$pmprowc_free_shipping_levels = array( '1', '2' ); | |
$free_shipping_key = ""; | |
foreach( $rates as $key => $val ){ | |
if( strpos( $key, 'free_shipping' ) !== false ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Use a custom checkout_renewal.html email template for renewals. | |
Add this code to a custom plugin. | |
Make sure there is a folder /email/ in the plugin folder. | |
Add a file /email/checkout_renewal.html in that email folder. | |
*/ | |
function my_pmpro_email_checkout_renewal($email) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This gist will disable the default behavior in PMPro BuddyPress 5.2.5 or earlier, | |
* which would redirect users away from the BP profile pages if you had | |
* "all of BuddyPress" locked down for non-members or members of a specific level. | |
* | |
* We might address this in future versions of the Add-On, but for now, you can use | |
* this gist. Add it to a Code Snippet or a custom plugin. | |
*/ | |
// First disable the default PMPro BuddyPress behavior. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function disqus_embed($disqus_shortname) { | |
global $post; | |
wp_enqueue_script('disqus_embed','http://'.$disqus_shortname.'.disqus.com/embed.js'); | |
echo '<div id="disqus_thread"></div> | |
<script type="text/javascript"> | |
var disqus_shortname = "'.$disqus_shortname.'"; | |
var disqus_title = "'.$post->post_title.'"; | |
var disqus_url = "'.get_permalink($post->ID).'"; | |
var disqus_identifier = "'.$disqus_shortname.'-'.$post->ID.'"; | |
</script>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Based on the Register Helper example. | |
* We've added a "buddypress" option for each field | |
* set to the XProfile name we used when setting up | |
* the fields in the BuddyPress extended profile. | |
* If the PMPro BuddyPress Add On is activated | |
* then the fields will be synchronized. | |
* Register Helper: https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
* PMPro BuddyPress: https://www.paidmembershipspro.com/add-ons/buddypress-integration/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Test Stripe webhook events | |
Add to a custom plugin, then visit /?teststripe=1 | |
*/ | |
function init_test_stripe() { | |
if(!empty($_REQUEST['teststripe'])) { | |
$_REQUEST['event_id'] = 'evt_9ktqwT5xFlKNOp'; //EDIT THIS to be the ID of an actual recurring payment event in your account | |
require_once(PMPRO_DIR . "/services/stripe-webhook.php"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
/** | |
* Sample instance based method. | |
*/ | |
class WC_Shipping_Test_Method extends WC_Shipping_Method { |
NewerOlder