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
//Changes default content | |
function mypmpro_change_user_pages_content($postdata, $user, $level){ | |
$postdata['post_content'] = 'My Content Here'; | |
return $postdata; | |
} | |
add_filter('pmpro_user_page_postdata', 'mypmpro_change_user_pages_content', 10, 3); |
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 &pmpropp_chosen_plan=<<plan_id>> in the URL to preselect the payment plan option. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_payment_plan_select_url() { | |
// Only load this on the checkout page. | |
if ( function_exists('pmpro_is_checkout') && !pmpro_is_checkout() ) { | |
return; | |
} |
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 | |
function mypmpro_redirect_away_from_wc_endpoint(){ | |
$current_endpoint = WC()->query->get_current_endpoint(); | |
if($current_endpoint == "downloads" ) { | |
$user = wp_get_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
<?php //do not copy | |
/** | |
* This recipe can either be run by adding /wp-admin/?cleanup=1 to your URL | |
* Or add the mypmpro_cleanup_spam_users function as a callback to a cron using WP Crontrol | |
* | |
* USE AT YOUR OWN RISK - Bulk deleting user data is irreversible and can result in active memberships | |
* and subscriptions being cancelled. | |
* | |
* Add this code to your PMPro Customizations Plugin - 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 //do not copy | |
function my_pmpro_user_page_purchase_postdata_content($postdata, $user, $level){ | |
if( $level->ID == 1 || $level->ID == 3 ) { | |
//Horizon | |
$postdata['post_content'] = 'THIS IS HORIZON'; | |
} else if( $level->ID == 2 || $level->ID == 4 ) { | |
//Galaxy |
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 | |
function mypmpro_remove_level_will_be_removed_text($translated_text, $text, $domain) { | |
if( $domain == "paid-memberships-pro" ) { | |
if( $text == "Your current membership level of %s will be removed when you complete your purchase." ) { | |
$translated_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 | |
/** | |
* Adds an email variable !!tax!! to Paid Memberships Pro emails. | |
* Only works for email templates that has the !!invoice_id!! variable available. | |
* Use the Email Templates Admin Editor to add !!tax!! to your email templates. | |
* Follow this guide to add this code to your site: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
* Difficulty: Easy | |
*/ | |
function my_pmpro_email_variable( $data, $email ) { |
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 | |
function my_pmpro_not_logged_in_text_filter($text){ | |
$text = '<h4>Account Information</h4><p>Enter account details or, if you’re already a user, <a href="/login?redirect_to=' . urlencode($_SERVER['REQUEST_URI']) . '">login here.</a></p>'; | |
return $text; | |
} | |
add_filter("pmpro_not_logged_in_text_filter", "my_pmpro_not_logged_in_text_filter", 5); |
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 is an example to stop non-approved user's from logging in using the Approvals Add On For Paid Memberships Pro. | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_stop_users_logging_in( $user, $password ) { | |
$user_id = $user->ID; |
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 logs out non-approved members after checkout. | |
* | |
* Requires PMPro Approvals - pmpro-approvals | |
* https://www.paidmembershipspro.com/add-ons/approval-process-membership/ | |
* | |
* 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. |
NewerOlder