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 | |
/** | |
* Redirect user based on user role after successful login. | |
* | |
* $pmpro_pages returns an array: | |
* * $pmpro_pages['account'] | |
* * $pmpro_pages['billing'] | |
* * $pmpro_pages['cancel'] | |
* * $pmpro_pages['checkout'] | |
* * $pmpro_pages['confirmation'] |
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 | |
/** | |
* customize_pmpro_login_redirect_url Creates conditions for each level to have its own confirmation URL | |
* | |
* @param [type] $return_url Different URL for each level | |
* @param [type] $request URL the user is coming from, ie login url. | |
* @param [type] $user user data | |
* @return [type] The URL of the level for user logging in | |
*/ | |
function customize_pmpro_login_redirect_url( $return_url, $request, $user ) { |
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 | |
/** | |
* Show next payment date under 'Expiration' field in PMPro account page. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Works for PayPal Express and Stripe payment gateways. | |
* www.paidmembershipspro.com | |
*/ | |
// Change the expiration text to show the next payment date instead of the expiration date | |
// This hook is setup in the wp_renewal_dates_setup function below | |
function my_pmpro_expiration_text($expiration_text) { |
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
/* | |
Sync fields to MailChimp | |
*/ | |
function sidetrack_mailchimp_listsubscribe_fields($fields, $user) | |
{ | |
$new_fields = array( | |
"NEWSLETTER SELECTION" => $user->sidetrack_newsletter_selection); | |
$fields = array_merge($fields, $new_fields); | |
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 | |
function my_pmpro_confirmation_url($rurl, $user_id, $pmpro_level) | |
{ | |
if(pmpro_hasMembershipLevel(1)) | |
$rurl = "http://example.com/page_1"; | |
elseif(pmpro_hasMembershipLevel(2)) | |
$rurl = "http://example.com/page_2"; | |
elseif(pmpro_hasMembershipLevel(3)) | |
$rurl = "http://example.com/page_3"; |
NewerOlder