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
//Add the membership level ID and name to the Stripe description | |
function my_pmpro_stripe_order_description($description, $order) | |
{ | |
$membership_level = $order->getMembershipLevel(); | |
$description = "ID: ".$membership_level->id. ", ".$membership_level->name.", ".$description; | |
return $description; | |
} | |
add_filter('pmpro_stripe_order_description', 'my_pmpro_stripe_order_description', 10, 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
/* | |
Set PMPro to charge in different currencies based on IP Geolocation. | |
Requires the GeoIP Detect plugin (https://wordpress.org/plugins/geoip-detect/) | |
*/ | |
function pmpro_determine_country_from_ip() | |
{ | |
global $country_from_ip; | |
//check if the GEO IP Detect plugin is active |
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
<iframe src="https://amedmarket.app.box.com/embed/s/z5ywvjsia9qpllfj1yaq7gni6398ql6g?sortColumn=date" width="800" height="550" frameborder="0" allowfullscreen webkitallowfullscreen msallowfullscreen></iframe> |
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
<iframe src="https://app.box.com/embed/s/0dtgl906gz1vsrqp1w6paqxhwuarn1mv?sortColumn=date" width="500" height="400" frameborder="0" allowfullscreen webkitallowfullscreen msallowfullscreen></iframe> |
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
/* | |
When users expire we give them another "expired" level. | |
When users cancel, just give them level = 0, ie same as a normal WP user. | |
*/ | |
function pmpro_after_change_membership_level_default_level($level_id, $user_id) | |
{ | |
//if we see this global set, then another gist is planning to give the user their level back | |
global $pmpro_next_payment_timestamp, $wpdb; | |
if(!empty($pmpro_next_payment_timestamp)) |
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
function my_pmpro_level_cost_text($r, $level, $tags, $short) | |
{ | |
//remove the existing string/level cost text | |
$r = ''; | |
//initial payment | |
if(!$short) | |
$r = sprintf(__('The price for membership is <strong>%s</strong> now', 'pmpro'), pmpro_formatPrice($level->initial_payment)); | |
else | |
$r = sprintf(__('<strong>%s</strong> now', 'pmpro'), pmpro_formatPrice($level->initial_payment)); |
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
# Set color codes for directory and Git branch | |
dir_color='%F{blue}' | |
branch_color='%F{green}' | |
# Set Git branch state color codes | |
uncommitted_color='%F{red}' | |
untracked_color='%F{yellow}' | |
ahead_color='%F{cyan}' | |
behind_color='%F{magenta}' | |
conflicted_color='%F{red}' |
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
/*Creates a PMPro email shortcode for the sponsored members message to use for greater control over location of message. | |
Use !!sponsored_message!! in email checkout body to display. | |
Removes the automatic insertion of message at the top of the email. | |
*/ | |
function my_sponsored_email_shortcode($pmpro_email) | |
{ | |
global $wpdb, $pmprosm_sponsored_account_levels; | |
$user_id = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_email = '" . $pmpro_email->data['user_email'] . "' LIMIT 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 | |
/*Donate to specific categories or causes using PMPro Register Helper. This is different and independent from the PMPro Donations Add On.*/ | |
function my_pmpro_checkout_level($level) | |
{ | |
$donation = 0; | |
if(!empty($_REQUEST['donation_general_npso_gift']) && is_numeric($_REQUEST['donation_general_npso_gift'])) | |
{ | |
// $level->initial_payment = $level->initial_payment + ; | |
$donation = $donation + $_REQUEST['donation_general_npso_gift']; |
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
/* | |
Only show levels on level page which the original content belonged to. For example if a site has 3 levels: Bronze, Silver, Gold and | |
a post is restricted to Silver and Gold, clicking on the "Register" button will lead them to the levels page showing only Silver and Gold levels. | |
To use: employ the shortcode [my_level_link] under Memberships >> Advanced >> Message for Logged-out Users (or Message for Logged-in Non-members) | |
Ex: | |
This content is for !!levels!! members only.<br /><a href="http://example.com/wp-login.php">Log In</a> <a href="[my_level_link]">Register</a> | |
*/ |
NewerOlder