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 line. | |
/** | |
* This recipe creates Member Numbers | |
* Change the generate_member_number function if your member number needs to be in a certain format. | |
* Member numbers are generated when users are registered or when the membership account page is accessed for the first time. | |
* | |
* 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 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 line. | |
/** | |
* This will change all instances of seat(s) to student(s) for the Sponsored Members Add On | |
* https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/ | |
* | |
* 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 | |
/* | |
* Plugin Name: Paid Memberships Pro - Canadian Tax | |
* Description: Apply Canadian taxes to Checkouts with PMPro | |
* Version: .1 | |
* Author: Stranger Studios | |
* Author URI: http://www.strangerstudios.com | |
*/ | |
/* |
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. // TESTING | |
/** | |
* Added SQL to a function. Run once then disable. | |
* | |
* Bulk update all users to have an expiration date that belong to a specific membership level. | |
* Visit https://yoursite.com/wp-admin/?my_query=1 when logged in as an admin to have existing users updated. | |
* Remove this code when finished. | |
* | |
* Please update the wp_ prefix to match that of your database as well as the membership_id and enddate value (YYYY-MM-DD). | |
* |
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 line. | |
/** | |
* Get PMPro WooCommerce to work with PMPro Set Expiration Dates | |
* Mostly assumes annually expiring levels. Use at your own risk. | |
* | |
* 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 | |
/** | |
* 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 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 | |
/* | |
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 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
/* | |
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 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
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 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 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 | |
*/ |