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 | |
/** | |
* Tweaked from BCC Admin on Member Emails - https://www.paidmembershipspro.com/bcc-additional-email-addresses-on-member-or-admin-notifications/ | |
* Add this code to your PMPro Customizations Plugin. | |
* Adjust the membership ID to match that of your levels. | |
*/ | |
function my_pmpro_email_headers( $headers, $email ) { | |
// Default BCC address to default email address. |
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 | |
/** | |
* Create payment plans by mapping a level to discount codes representing payment plan options. | |
* Useful for offering multiple pricing structures for membership (i.e. Monthly, Annually) | |
* | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
global $pmpro_payment_plans; |
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 | |
/** | |
* This shows the WordPress User ID as a Member ID on the Paid Memberships Pro Account Page. | |
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* www.paidmembershipspro.com | |
*/ | |
function pmpro_add_user_id_account() { | |
global $current_user; |
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 WP new user email and PMPro admin change email after registering a member through a PMPro Zapier zap | |
* Requires Paid Memberships Pro and PMPro Zapier add on to be installed and activated - https://www.paidmembershipspro.com/add-ons/pmpro-zapier/ | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_zapier_email_after_change_level( $level_id, $user_id ){ | |
if( isset( $_SERVER["REQUEST_URI"] ) && ( strpos( $_SERVER["REQUEST_URI"], "pmpro_zapier_webhook" ) !== 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
<?php | |
/** | |
* Show next payment date under 'Expiration' field in PMPro account page. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Works for PayPal Express and Stripe payment gateways. | |
* www.paidmembershipspro.com | |
*/ | |
// Change the expiration text to show the next payment date instead of the expiration date | |
// This hook is setup in the wp_renewal_dates_setup function below | |
function my_pmpro_expiration_text($expiration_text) { |
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 | |
/** | |
* Adds a custom phone field to PMPro checkout page. | |
* Requires the PMPro Register Helper Add On to be installed and activated - https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmprorh_init() | |
{ | |
//don't break if Register Helper is not loaded |
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 | |
/** | |
* This will exclude products that belong to a specific category from the membership discount. | |
* Add the below code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_exclude_woocommerce_discounts_for_categories( $price, $level_id, $original_price, $product ) { | |
// Array of categories to exclude, uses category slug. | |
$exclude_categories = array( 'category-1', 'category-2', 'category-3' ); |
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 return the post thumbnail (featured image) on restricted content when viewed by a non-member. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
* | |
*/ | |
function hide_post_thumbnail_on_restricted_content( $html, $post_id, $post_image_id ) { | |
if ( function_exists( 'pmpro_has_membership_access' ) ) { |
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 | |
/* | |
* Redirect on login if user has any failed payments. (Requires Paid Memberships Pro Failed Payment Limit Add On) | |
* Adjust the code on the line the line "site_url( ' payment-failed')" to redirect to page of your prefereance. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_login_redirect_url( $url, $request, $user ) { | |
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 | |
/** | |
* Stop members from renewing their current membership level. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function stop_members_from_renewing( $okay ) { | |
// If something else isn't okay, stop from running this code further. | |
if ( ! $okay ) { |