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_user_has_cap($allcaps, $caps, $args, $user) | |
{ | |
if($user->ID !== 1) | |
unset($allcaps['pmpro_reports']); | |
return $allcaps; | |
} | |
add_filter('user_has_cap', 'my_pmpro_user_has_cap', 10, 4); |
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 | |
/* | |
Custom checkout.php page for PMPro. | |
Replaces "State" billing field text field with a dropdown for longform addresses. | |
Based on PMPro v1.8.9.1. | |
*/ | |
global $gateway, $pmpro_review, $skip_account_fields, $pmpro_paypal_token, $wpdb, $current_user, $pmpro_msg, $pmpro_msgt, $pmpro_requirebilling, $pmpro_level, $pmpro_levels, $tospage, $pmpro_show_discount_code, $pmpro_error_fields; | |
global $discount_code, $username, $password, $password2, $bfirstname, $blastname, $baddress1, $baddress2, $bcity, $bstate, $bzipcode, $bcountry, $bphone, $bemail, $bconfirmemail, $CardType, $AccountNumber, $ExpirationMonth,$ExpirationYear; | |
/** |
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
/* | |
Force the PMPro expiration script to run immediately. | |
Add this code into a custom plugin, then login as an admin and visit /?expirenow=1 | |
*/ | |
function pmpro_cron_expire_memberships_now() { | |
if(!empty($_REQUEST['expirenow']) && current_user_can('manage_options')) { | |
echo "Forcing expirations now<hr />"; | |
pmpro_cron_expire_memberships(); | |
exit; |
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
[pmpro_signup level="1" short="false" title="Member Signup" intro="Enter your email and create a password for access."] |
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 | |
/* | |
Update line 8 with the array of sidebar IDs you want to filter. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function my_pmpro_widget_display_callback($instance, $widget, $args) { | |
$hide_sidebars_array = array('sidebar-1','sidebar-2'); | |
global $post; | |
if( is_user_logged_in() && function_exists('pmpro_has_membership_access') && !pmpro_has_membership_access($post->ID)) { |
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 | |
/* | |
Plugin Name: PMPro Member Count Shortcode | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Show the number of members in a level w/a status | |
Version: .2 | |
Author: Thomas Sjolshagen @ Stranger Studios <[email protected]>, strangerstudios | |
Author URI: http://www.strangerstudios.com | |
*/ | |
function pmpro_member_count_shortcode( $attrs = null ) |
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_gettext_pmproap_changes($translated_text, $text, $domain) | |
{ | |
if($domain == "pmproap" && $text == "Purchase this Content (%s)") | |
$translated_text = "Purchase Now for %s"; | |
elseif($domain == "pmproap" && $text == "Choose a Membership Level") | |
$translated_text = "Choose a Plan"; | |
return $translated_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
function my_pmpro_confirmation_url($url, $user_id, $level) { | |
$already_member = get_user_meta($user_id, 'already_member', true); | |
if(!$already_member) { | |
update_user_meta($user_id, 'already_member', 1); | |
$url = home_url('/my-dashboard'); | |
} | |
return $url; | |
} | |
add_filter('pmpro_confirmation_url', 'my_pmpro_confirmation_url'); |
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
/* | |
Use a custom checkout_renewal.html email template for renewals. | |
Add this code to a custom plugin. | |
Make sure there is a folder /email/ in the plugin folder. | |
Add a file /email/checkout_renewal.html in that email folder. | |
*/ | |
function my_pmpro_email_checkout_renewal($email) { |
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
/* | |
Use this recipe in conjunction with PMPro bbPress Add On | |
plus this gist: https://gist.github.com/strangerstudios/ff354cd84254b856ef5194c4259c9e38 | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function pmpro_expiration_date_shortcode_output() { | |
$user_id = bbp_get_user_id( 0, true, false ); | |
?> |