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
/* | |
When users cancel (are changed to membership level 0) who previously belonged to | |
level 2 are given level 1 with expiration date of one year. | |
*/ | |
function my_pmpro_after_change_membership_level($level_id, $user_id) | |
{ | |
$levelshistory = $wpdb->get_results("SELECT * FROM $wpdb->pmpro_memberships_users WHERE user_id = '$current_user->ID' ORDER BY id DESC"); | |
if($levelshistory && $levelshistory[0]->membership_id == 2 && $level_id == 0) | |
{ |
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 | |
/** | |
* Hide Auto-Renewal Checkbox for Check payment | |
*/ | |
function my_pmpropbc_enqueue_scripts() { | |
global $pmpro_pages; | |
if(is_page($pmpro_pages['checkout'])) { |
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 | |
/** | |
* Once a user checks out for a level, it will add usermeta to the user's account. | |
* This will then remove any subscription delay for that member in the future, even if the user cancels and then re-signs up. | |
*/ | |
// Update level meta everytime a user changes their level to ensure they are blocked from subscription delays. | |
function my_pmpro_trial_used( $level_id, $user_id ) { | |
update_user_meta( $user_id, "pmpro_trial_level_used", "1" ); // Assume the user has any level. | |
} |
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 | |
// Log user out after check out | |
function my_pmpro_after_checkout($user_id) | |
{ | |
wp_logout(); | |
} | |
add_action('pmpro_after_checkout', 'my_pmpro_after_checkout'); |
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 add custom proration for levels with a subcription delay | |
* until a specified date (like "Y1-08-01"). | |
* Prorates initial payment based on days until end of subscription delay for level 1 | |
* | |
* 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 | |
/** | |
* This will translate "Pay by Check" into "Pay by Cheque or Bank Transfer" | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* For more help visit www.paidmembershipspro.com | |
*/ | |
function my_pmpro_text_strings( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Pay by Check' : |
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 | |
/** | |
* Adjust the 'Join Now' link on the login page to a custom URL for Paid Memberships Pro. | |
* Follow this guide to add custom code to your membership site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_custom_join_now_link( $links, $allowed_html ) { | |
$links['register'] = '<a href="https://www.thefixxsquad.stylefixxdaily.com/pricing/">' . __( 'Join Now', 'paid-memberships-pro' ) . '</a>'; | |
return $links; | |
} | |
add_filter( 'pmpro_login_forms_handler_nav', 'my_pmpro_custom_join_now_link', 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
function my_pmprorh_init() { | |
// Don't break if Register Helper is not loaded. | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
return false; | |
} | |
// Define the fields. | |
$fields = array(); | |
$fields[] = new PMProRH_Field( | |
'machineId', // input name, will also be used as meta key |
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 help you change text on the checkout paid in PMPro | |
* 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/ | |
*/ | |
// paste content from below this line | |
function pmproc_change_my_text( $translated_text, $text, $domain ) { |
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 can be used to remove the Phone and Address 2 fields | |
* from the required billing fields for checkout. | |
* | |
* Note: Make sure your Gateway doesn't require it also. | |
* | |
* 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. |