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
/* Named colors are accessed from theme mods and selectors from "memberlite_defaults" global */ | |
$bgcolor_site_navigation_elements { | |
background: $bgcolor_site_navigation; | |
} | |
$color_site_navigation_elements { | |
color: $color_site_navigation; | |
} | |
$color_link_color_elements { |
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 | |
/** | |
* Use this script to generate users on the fly and assign them a membership level. | |
* Add ?pmpro_create_users=X where X is how many users you want to create. | |
* Adjust the $level_id for which level ID you want to give to users. | |
* Creates a user with username "user1234" for example. | |
*/ | |
function pmpro_create_my_own_users() { | |
if ( $_REQUEST['pmpro_create_users'] ) { |
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 check for !!company_name!! in the emails body and replace it with the 'company_name' metadata (created by Register Helper). | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_body( $body, $email ) { | |
//only checkout emails | |
if ( false !== strpos( $email->template, "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
const defaultComparator = (a, b) => a - b | |
const checkSort = (array, comparator = defaultComparator) => { | |
if (!Array.isArray(array)) { | |
throw new TypeError('Expected Array, got ' + (typeof array)) | |
} | |
return array.length <= 1 || array.some((k, i) => { | |
return comparator(k, array[i - 1]) > 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 | |
/** | |
* Calculate days remaining for current membership level and add it to new subscription. | |
* Only works for PMPro WooCommerce Integration | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* www.paidmembershipspro.com | |
*/ | |
function pmprowoo_add_days_to_level( $level_array ) { | |
$level_obj = pmpro_getLevel($level_array['membership_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 | |
/** | |
* Register Helper Fields | |
*/ | |
function my_pmprorh_init() { | |
if(!function_exists('pmprorh_add_registration_field')) return; | |
$fields = array(); |
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 trial if user has cancelled order for same level. | |
* Add code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_remove_trial_for_existing_members( $level ) { | |
$order = new MemberOrder(); | |
if ( $order->getLastMemberOrder( null, 'cancelled', $level->id ) ) { | |
$level->trial_limit = 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
// send WP new user email and PMPro admin change email after registering a member through a PMPro Zapier zap | |
// requires Paid Memberships Pro and PMPro Zapier add on | |
function my_pmpro_zapier_email_after_change_level( $level_id, $user_id ){ | |
if( isset( $_SERVER["REQUEST_URI"] ) && ( strpos( $_SERVER["REQUEST_URI"], "pmpro_zapier_webhook" ) !== false ) ){ | |
$user = get_userdata( $user_id ); | |
$pmpro_email = new PMProEmail(); | |
$pmpro_email->sendAdminChangeEmail( $user ); | |
wp_new_user_notification( $user_id, null, 'both' ); | |
} |
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 users without access to a single bbPress forum to the Membership Levels page. | |
* | |
*/ | |
function redirect_bbpress_no_access_levels_page( $redirect_to, $forum_id ) { | |
global $pmpro_pages; | |
$redirect_to = get_permalink( $pmpro_pages['levels'] ); | |
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 | |
/* | |
* Bcc additional email addresses on all PMPro emails sent to the member. | |
*/ | |
function bcc_on_member_email_headers( $headers, $email ) { | |
//bcc emails not already going to admin_email | |
if ( $email->email != get_bloginfo( 'admin_email' ) ) { | |
//add bcc | |
$headers[] = "Bcc:" . "otheremail@domain.com,anotheremail@domain.com"; | |
} |