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 | |
/** | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* The my_pmpro_renew_membership_shortcode is a custom function creating a renew link for members. | |
* Use the shortcode [pmpro_renew_button] to display the button anywhere on your site where shortcodes are recognized. | |
* | |
* @return string A link containing the URL string to renew. | |
*/ | |
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 | |
/* | |
Give level 1 members access to everything. | |
Add this to your active theme's functions.php or a custom plugin. | |
*/ | |
function my_pmpro_has_membership_access_filter($access, $post, $user) | |
{ | |
if(!empty($user->membership_level) && in_array( $user->membership_level->ID, array( 12, 14 ) ) ) |
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
/* | |
Add bcc for PMPro admin emails. | |
Change [email protected],[email protected] below to the addresses you want to use. | |
Add this code to your active theme's functions.php or a custom plugin | |
a la http://www.paidmembershipspro.com/2012/08/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_headers_bcc($headers, $email) | |
{ | |
//bcc emails going to admins | |
if(strpos($email->template, "admin") !== 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
function my_pmpro_ipn_check_receiver_email($check, $email) | |
{ | |
if($email == '[email protected]' || in_array('[email protected]', $email)) //change email here to the old email | |
$check = true; | |
return $check; | |
} | |
add_filter('pmpro_ipn_check_receiver_email', 'my_pmpro_ipn_check_receiver_email', 10, 2); |
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 | |
/** | |
* Copy the function below into your custom plugin / Code Snippets plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Replace [pmpro_account] with [my_pmpro_account] | |
* This example replaces "Change Password" link to point to site's password-reset URL. | |
*/ | |
/* | |
my custom Shortcode to show membership account information | |
*/ |
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 recipe will Remove Confirm Email and Confirm Password | |
* | |
* 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 | |
/** | |
* Show next payment date under 'Expiration' field on My Membership box | |
* 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 // do not copy this line. | |
/** | |
* This recipe will add a message before the submit button | |
* | |
* 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 | |
// Copy from below here | |
/** | |
* Will redirect users without a $required_levels away from pages where the request uri begins with '/places/'. | |
* Useful to lock down the archive page and CPTs of GeoDirectory plugin. | |
*/ | |
function my_pmpro_redirect_places() { | |
$request_uri_to_redirect = '/dog-profile'; |
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 line. | |
/** | |
* Add the membership level ID and name to the Stripe description | |
* | |
* 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/ | |
*/ |