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 //do not copy | |
function mypmpro_remove_content_changes_avada() { | |
remove_filter( 'the_content', 'pmpros_the_content' ); | |
} | |
add_action( 'awb_remove_third_party_the_content_changes', 'mypmpro_remove_content_changes_avada', 5 ); | |
// Add the_content restriction back for Avada. | |
function mypmpro_readd_content_changes_avada() { | |
add_filter( 'the_content', 'pmpros_the_content' ); |
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 | |
/* | |
Custom Tax Example. | |
- Requires PMPro 1.3.13 or higher. | |
- Leave the tax fields blank in the payment settings. | |
- Level 1 has no tax. | |
- Other levels have 7.25% tax for CA customers only. | |
- We update the price description to include the tax amount. | |
*/ | |
function my_pmpro_tax($tax, $values, $order) |
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 | |
/** | |
* Forward IPN requests from WooCommerce PayPal Standard to also send to Paid Memberships Pro. | |
* Please change the URL on line 9 to match that of your Paid Memberships Pro site URL. | |
* Follow this guide to add this to your site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_forward_ipn() { | |
if ( isset( $_REQUEST['callback'] && $_REQUEST['callback'] == 'gravityformspaypal' ) { | |
$fp = wp_remote_post( 'https://saac-arts.org/wp-admin/admin-ajax.php?action=ipnhandler', $_POST ); | |
} |
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 | |
/** | |
* Change the account page expiration text to "Until Cancelled" | |
* for never expiring levels/members. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_adjust_expiration_text( $expiration_text, $level ) { | |
if ( strpos( $expiration_text, '—' ) !== false) { | |
$expiration_text = __( 'Until Cancelled', 'paid-memberships-pro' ); |
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 //do not copy | |
/** | |
* This recipe will save a utm_source value when a visitor lands on the checkout | |
* page. This then gets stored in order meta upon successful checkout. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ |
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 //do not copy | |
/** | |
* This recipe adds an Affiliate Area link to the bottom of the member links section | |
* on the member's account page. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ |
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 //do not copy | |
/** | |
* This recipe adds the pmpro_pending_approval class to the pmpro_content_message | |
* element if the current user is pending approval. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ |
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 //do not copy | |
/** | |
* This recipe ensures that only products that are NOT on sale will be discounted | |
* when using the Woocommerce Add On. | |
* All other products will be discounted as expected. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. |
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 //do not copy | |
/** | |
* This recipe will either add a fee or discount to specific variations of a Woo | |
* product based on the level that the user holds. | |
* | |
* In the below example, variation ID 107 should have level 1 and a fee of 1500 will be added. | |
* Variation ID 108 requires a level 2 and applies a discount of 8 | |
* | |
* You can add this recipe to your site by creating a custom plugin |
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 // don't copy this line | |
/** | |
* Adds Custom User Fields to the Approvals Email. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ |