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
/* | |
Automatically generate password on checkout page. | |
Note: if you want to remove the entire user area and generate usernames and passwords, simply set the pmpro_skip_account_fields filter to return false. | |
Use the intstructions here (http://www.paidmembershipspro.com/documentation/advanced-techniques/templates/) to add a checkout page template with the password fields removed. | |
Uncheck the "Default WP notification email. (Recommended: Leave unchecked. Members will still get an email confirmation from PMPro after checkout.)" option in the PMPro Emails Settings tab. | |
*/ | |
function my_generate_passwords() |
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 the function (below) to your PMPro Customizations Plugin. | |
* This will add your SSL Seal code just before the submit button of checkout. | |
*/ | |
function load_my_ssl_seal_to_checkout() { | |
echo '<!--- DO NOT EDIT - GlobalSign SSL Site Seal Code - DO NOT EDIT --><table width="125" border="0" cellspacing="0" cellpadding="0" title="CLICK TO VERIFY: This site uses a GlobalSign SSL Certificate to secure your personal information."><tr><td><span id="ss_img_wrapper_gmogs_image_125-50_en_white"><a href="https://www.globalsign.com/" target="_blank" title="GlobalSign Site Seal" rel="nofollow"><img alt="SSL" border="0" id="ss_img" src="//seal.globalsign.com/SiteSeal/images/gs_noscript_125-50_en.gif"></a></span></td></tr></table><!--- DO NOT EDIT - GlobalSign SSL Site Seal Code - DO NOT EDIT -->'; | |
} | |
add_action( 'pmpro_checkout_before_submit_button', 'load_my_ssl_seal_to_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 will adjust membership pricing depending on users current level and level checking out for. See line 10. | |
* This will show you how to adjust the initial amount and/or the recurring amount. If the existing level, in this case 5, is not a recurring level please uncomment lines 12-14. | |
* Add this code (L8 - L20) to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_adjust_price_for_members( $level ) { | |
// Adjust price for existing members that currently have level 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 | |
/** | |
* Remove the homepage replacement on the Member HomePages Add On for Paid Memberships Pro. | |
* This will only remove the homepage replacement for administrators. | |
* Add this code (L9-L14 only) to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function remove_memberhome_pages_redirect(){ | |
if ( current_user_can( 'manage_options' ) ) { |
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 code allows you to filter the default blog (archive) page to hide posts with certain category ID's from members. | |
* This is useful if you want to hide free content from paying members. | |
* Adjust line 16 & 21 to your needs. If the user does not have a membership level, the posts page won't be filtered/changed. | |
* | |
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Reference: https://developer.wordpress.org/reference/hooks/pre_get_posts/ | |
* www.paidmembershipspro.com | |
*/ |
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 adds a custom link to the account page for Paid Memberships Pro. | |
* 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_billing_page_link() { | |
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
global $wpdb; | |
$results = $wpdb->get_results( "SELECT * FROM $wpdb->pmpro_memberships_users WHERE status='cancelled' AND enddate IS NOT NULL AND DATE_ADD(startdate, INTERVAL 7 DAY) >= enddate AND membership_id='1'" ); |
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 a member for first time login. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* www.paidmembershipspro.com | |
*/ | |
function first_time_login_redirect( $redirect_to, $request, $user ) { | |
//check level | |
if ( ! empty( $user ) && ! empty( $user->ID ) && function_exists( 'pmpro_getMembershipLevelForUser' ) ) { |
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 non-approved members from the Membership Account Page for Paid Memberships Pro. | |
* Requires PMPro Approvals Add On to be installed - https://www.paidmembershipspro.com/add-ons/approval-process-membership/ | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* www.paidmembershipspro.com | |
*/ | |
function my_redirect_non_approved_members(){ | |
global $current_user; |