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_email_headers_admin_emails($headers, $email) | |
| { | |
| $args = array('role' => 'pmpro_membership_manager'); | |
| $membership_managers = get_users($args); | |
| $membership_managers_emails = array(); | |
| foreach($membership_managers as $membership_manager) | |
| { | |
| $membership_managers_emails[] = $membership_manager->user_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
| /* | |
| Add bcc for PMPro admin emails. | |
| Change [email protected],[email protected] below to the addresses you want to use. | |
| Add this code to your active theme's functions.php or a custom plugin | |
| a la http://www.paidmembershipspro.com/2012/08/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_email_headers_bcc($headers, $email) | |
| { | |
| //bcc emails going to admins | |
| if(strpos($email->template, "admin") !== false) |
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 | |
| //copy lines 5 - 12 into your theme's functions.php or custom plugin | |
| function filter_pmpro_default_country( $default_country ) { | |
| // Set country code to "JP" for Japan. | |
| $default_country = "JP"; | |
| return $default_country; | |
| } |
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
| // always show renew links for certain levels if the member already has that level. | |
| function my_pmpro_always_show_renew_levels( $show, $level ){ | |
| /*--- change this line to the levels you want to show a renew link---*/ | |
| $show_levels = array( 1, 2 ); | |
| if( in_array( $level->id, $show_levels ) ) { | |
| $show = true; | |
| } |
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 | |
| /** | |
| * Set a default membership level when a user expires (only). | |
| * This does not set the default level when a user cancels. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function pmpro_set_default_level_only_when_expiring( $user_id, $level_id ) { | |
| pmpro_changeMembershipLevel( 1, $user_id ); // Change this to default 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
| <?php | |
| // Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| add_filter( 'gettext', 'change_text_for_add_paypal_express', 20, 3 ); | |
| /** | |
| * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
| */ | |
| function change_text_for_add_paypal_express( $translated_text, $text, $domain ) { | |
| switch ( $translated_text ) { | |
| case 'Choose Your Payment Method': | |
| $translated_text = __( 'Choose Your Payment Method', 'pmpro' ); |
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 | |
| /** | |
| * This code snippet allows admins without any PMPro membership level to access any restricted content. | |
| * Add this code to your PMPro Customizations plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function pmmpro_allow_access_for_admins($hasaccess, $mypost, $myuser, $post_membership_levels){ | |
| //If user is an admin allow access. | |
| if( current_user_can( 'manage_options' ) ){ |
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 | |
| /** | |
| * Only require Email Address to create user. | |
| * This recipe requires Paid Memberships Pro and the Register Helper Add On. | |
| * | |
| * Note: this recipe depends on a future patch to Paid Memberships Pro core plugin in order to function. | |
| */ | |
| /** | |
| * Hide the Account Information Section |
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: Paid Memberships Pro - Canadian Tax | |
| * Description: Apply Canadian taxes to Checkouts with PMPro | |
| * Version: .1 | |
| * Author: Stranger Studios | |
| * Author URI: http://www.strangerstudios.com | |
| */ | |
| /* |
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 | |
| // Copy from below here... | |
| /* | |
| * Restricts all posts. Only users with a level can view | |
| * regardless of what is set in the "Require Membership" box. | |
| * | |
| * Can change 'post' on line 12 to any CPT. | |
| */ |