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 this function to a custom plugin. | |
Update your membership confirmation text then to include a reminder about confirming your email. | |
*/ | |
function pmpro_hide_account_page_until_validated() { | |
//bail if pmpro or the email confirmation addon is not loaded | |
if(!function_exists('pmpro_getMembershipLevelForUser') || !function_exists('pmproec_isEmailConfirmationLevel')) | |
return; |
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 - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* This function below sends a custom HTML email to the user that checks out for a pmpro membership level, easily extendible to send to admins, or specific users and so on. | |
* Website: https://paidmembershipspro.com | |
*/ | |
//let's send a custom email after user checkouts. This will not send an email if an admin changes user's level inside member area. | |
function custom_email_after_checkout( $user_id, $morder ){ |
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 | |
/* | |
Changes Report for Paid Memberships Pro | |
Title: pmpro_reports_changes | |
Slug: pmpro_reports_changes | |
*/ | |
//update this array for your desired reports. the format is: "report name" => array( initial_level_id, current_level_id ), | |
global $pmpro_reports_level_changes; | |
$pmpro_reports_level_changes = array( |
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 data from the wp_users, wp_user_meta, or BuddyPress xProfile fields tables to the Members List CSV Export. | |
The pmpro_members_list_csv_extra_columns passes an array of columns. | |
The keys of the array are the column headings. The values are callback functions to get the value for that row. | |
*/ | |
//add the column to the export | |
function my_pmpro_members_list_csv_extra_columns ( $columns ) { |
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 | |
//Save the pmpro_show_level_ID field | |
function pmpro_hide_level_from_levels_page_save( $level_id ) { | |
if( $level_id <= 0 ) { | |
return; | |
} | |
$limit = $_REQUEST['pmpro_show_level']; | |
update_option( 'pmpro_show_level_'.$level_id, $limit ); | |
} | |
add_action( 'pmpro_save_membership_level','pmpro_hide_level_from_levels_page_save' ); |
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_levels_array($levels) | |
{ | |
//a comma-separated list of the levels to hide | |
$hiddenlevels = array(1); | |
//build the filtered levels array | |
$newlevels = array(); | |
foreach($levels as $key => $level) { | |
if( !in_array( $level->id, $hiddenlevels ) ) { | |
$newlevels[$key] = $level; |
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 a .5s delay every time the checkout PMPro checkout button is clicked. | |
This is meant to prevent automated scripts from testing your checkout page repeatedly. | |
We will likely update this script to keep track on the server side as well to account for cases | |
where the script reloads the entire page with every attempt. | |
*/ | |
function enqueue_scripts_slowdown_checkout() { | |
?> | |
<script> | |
function my_disablePMProCheckoutButtons() { |
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 Website and Biographical Info to Membership Checkout | |
*/ | |
function my_default_wp_user_checkout_fields() | |
{ | |
if(class_exists("PMProRH_Field")) | |
{ | |
pmprorh_add_checkout_box("additional", "Additional Information"); | |
$fields = array(); | |
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 hide_discount_code_field_for_specific_levels($show) | |
{ | |
global $pmpro_level; | |
if( in_array( $pmpro_level->id, array(1,2) ) ) | |
{ | |
$show = false; | |
} | |
return $show; | |
} |
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
#give all non-member WP users level 1 with a specific start and end date set | |
#change the level (1) below and start (2017-01-01) and end (2017-12-31) dates below to per your needs | |
INSERT INTO wp_pmpro_memberships_users (user_id, membership_id, status, startdate, enddate) | |
SELECT | |
u.ID, #ID from wp_users table | |
1, #id of the level to give users | |
'active', #status to give users | |
'2017-01-01', #start date in YYYY-MM-DD format | |
'2017-12-31' #end date in YYYY-MM-DD format, use '' for auto-recurring/no end date | |
FROM wp_users u |