This file contains hidden or 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 gets the payment plan associated with the level that is purchased | |
* and shows the relevant payment plan on the Membership Account page. | |
* | |
* This is used as a workaround when using the Payment Plans Add On only. | |
* | |
* 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. |
This file contains hidden or 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 | |
/** | |
* Fix apostrophe's used in the from name and sitename email variable in emails. | |
* | |
* 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 hidden or 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 | |
/** | |
* Support Set Expiration Date Add On for PMPro WooCommerce Add On. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmprowoo_set_expiration_date( $level_array ) { | |
// Make sure Set Expiration Date Add On is active. | |
if ( ! function_exists( 'pmpro_getSetExpirationDate' ) ) { | |
return $level_array; |
This file contains hidden or 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 | |
/** | |
* Add a shortcode to display content to members with an expired membership. | |
* | |
* Usage Example: | |
* [membership_expired]Shows if user's level expired[/membership_expired] | |
* [membership_expired level="1"]Shows if user's expired level ID matches[/membership_expired] | |
* [membership_expired levels="1, 2"]Shows if user's expired level ID matches one of the levels[/membership_expired] | |
* | |
* @param string $atts Shortcode level/levels IDs attributes. |
This file contains hidden or 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 | |
/** | |
* Add a shortcode to display a list of sponsored children. | |
* | |
* @param array $atts { | |
* Attributes for the shortcode. | |
* | |
* @type int $user_id The user ID of the sponsor. | |
* } | |
* |
This file contains hidden or 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 | |
/** | |
* Allow users with set custom roles access to the WordPress dashboard when users | |
* that also has a "Subscriber" role is being blocked if the Restrict Dashboard Access | |
* has been set on the Memberships > Settings > Advanced page. | |
* | |
* This should be helpful if users have multiple roles. | |
* | |
* 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. |
This file contains hidden or 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 | |
/** | |
* Example of changing the group (location ) to add a user field to. | |
* | |
* "$where" locations available on the checkout page are: | |
* - after_pricing_fields | |
* - after_username | |
* - after_password | |
* - after_email | |
* - checkout_boxes |
This file contains hidden or 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 | |
/** | |
* Allow users to add an avatar at checkout for the Basic User Avatars plugin. | |
* | |
* This recipe assumes that you have the Basic User Avatar plugin installed and activated. | |
* @link https://www.paidmembershipspro.com/add-ons/basic-user-avatar/ | |
* | |
* This recipe requires a custom user field created with the user field name set to basic_user_avatar. | |
* | |
* You can add this recipe to your site by creating a custom plugin |
This file contains hidden or 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 | |
/** | |
* Toggle the Payment Type user field on the checkout page when using the Pay by Check gateway. | |
* The Payment Type field is moved to below the Choose Your Payment Method part on the checkout page. | |
* | |
* This is a partner recipe for the guide | |
* Let Users Select Offline Payment Methods Using the “Pay by Check” Gateway | |
* @link https://www.paidmembershipspro.com/let-users-select-offline-payment-methods-using-the-pay-by-check-gateway/ | |
* | |
* This recipe assumes the following: |
This file contains hidden or 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 | |
// Copy from below here... | |
/** | |
* Prevent users from cancelling their membership or checking out for a new one. | |
*/ | |
function my_pmpro_redirect_cancel_to_stripe() { | |
global $pmpro_pages; | |
if ( ! empty( $pmpro_pages['cancel'] ) && is_page( $pmpro_pages['cancel'] ) ) { |