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 | |
| /** | |
| * Change the email address for all admin related emails in Paid Memberships Pro. | |
| * Follow this guide to add custom code to your WordPress site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_change_admin_to_email( $user_email, $email ){ | |
| if( strpos( $email->template, "_admin" ) !== false ) { | |
| $user_email = 'memberadmin@someemail.co'; | |
| } | |
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 | |
| /** | |
| * Edit Teaser Messages Depending on Content | |
| * | |
| */ | |
| function pmpro_pmpro_not_logged_in_text_filter( $text ) { | |
| global $post; | |
| $access = pmpro_has_membership_access( $post->ID, NULL, true ); | |
| $level_ids = $access[1]; |
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 recipe will change the name of "Discount Code" to something else for one level | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ |
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 - Australia GST | |
| Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-australia-gst/ | |
| Description: Apply Australia GST 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 // DO NOT COPY THIS LINE | |
| //copy lines 5 onwards into your active theme's function.php or custom plugin for code snippets. | |
| function mypmpro_redirect_logout(){ | |
| wp_safe_redirect( '/contact/' ); // use this line to redirect to a specific page on your site | |
| } | |
| add_action('wp_logout','mypmpro_redirect_logout'); |
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 http://yoursite.com/wp-admin/admin.php?&pmpro_reset_analytics=1 to your url while logged in. | |
| * Add this code to your Code Snippets / Custom Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * You may remove this code from your site when you don't need it any longer. | |
| */ | |
| function my_pmpro_reset_visit_data() { | |
| // Check if URL parameter pmpro_reset_analytics is set | |
| if ( isset( $_REQUEST['pmpro_reset_analytics'] ) ) { |
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 onwards into your 'PMPro Customizations' plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| function pmproc_change_my_text( $translated_text, $text, $domain ) { | |
| switch ( $translated_text ) { | |
| case 'State' : | |
| $translated_text = __( 'Region', 'paid-memberships-pro' ); | |
| break; | |
| } |
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 | |
| /** | |
| * Change the account page expiration text to "Until Cancelled" | |
| * for never expiring levels/members. | |
| * Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_adjust_expiration_text( $expiration_text, $level ) { | |
| if ( $expiration_text === 'Never' ) { | |
| $expiration_text = __( 'Until Cancelled', 'paid-memberships-pro' ); | |
| } |
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 sell to specific countries by adding in the 'allowed' countries' in | |
| * the $restricted_countries array. | |
| * change messages on line 35 and 51 for your site. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ |
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
| /* | |
| * | |
| * The following CSS code will hide the PMPro username field. | |
| * Add this CSS to Simple Custom CSS and JS: https://wordpress.org/plugins/custom-css-js/ | |
| * Code Recipe intended to be used along with the following gist: https://github.com/strangerstudios/pmpro-snippets-library/blob/dev/checkout/name-email-only-checkout.php | |
| * | |
| */ | |
| .pmpro_checkout-field-username { | |
| display: none; |