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 | |
/* | |
Change cancellation to set expiration date et expiration date to be the end of the current month, instead of cancelling immediately. | |
Assumes orders are generated for each payment (i.e. your webhooks/etc are setup correctly). | |
*/ | |
function e20r_stripe_delete_action( $user_id ) { | |
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
/** | |
* Consider member prices a "sale" so regular price is shown with a strikethrough | |
* If PMPro WooCommerce is active and setup to discount prices, | |
* then the calls to $product->get_price() will be filtered to return | |
* the member price. | |
* | |
* Add this code to a custom plugin. | |
*/ | |
function my_pmprowoo_woocommerce_product_is_on_sale( $on_sale, $product ) { | |
$regular_price = (float) $product->get_regular_price(); |
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 | |
/** | |
* Auto-populate user names for active members in a field drop-down. | |
* This will assume you are using a select field named "membership-list" | |
* The value of the select is the user's email and the label is set to the user's login name. | |
* Data Example: <option value="someemail@test.com">Test User</option> | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_auto_populate_members ( $tag, $unused ) { |
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 | |
/** | |
* This will redirect members with level 1 from site.com/page-slug to the home page. | |
* Please adjust accordingly and add to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function redirect_member_from_page_x() { | |
if ( is_page( 'page-slug' ) && pmpro_hasMembershipLevel( 1 ) ) { | |
wp_redirect( home_url() ); //redirect to home page. Change home_url() to home_url( '/page-slug' ) to redirect to specific page. |
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 | |
/** | |
* Redirect user's to a new URL instead of the 'levels' page in PMPro. | |
* Add this code to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function redirect_users_to_a_new_page( $url ){ | |
return 'https://some-url.com'; //change this to the URL you would like to redirect your user's to. |
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 | |
/** | |
* Redirect non-members away from 'normal' content to BuddyPress content restricted page. | |
* Requires the BuddyPress Integration to be installed - https://www.paidmembershipspro.com/add-ons/buddypress-integration/ | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_template_redirect_require_membership_access() { | |
if ( ! pmpro_has_membership_access() && ! bp_current_component() && ! is_archive() && ! is_home() && function_exists( 'pmpro_bp_redirect_to_access_required_page' ) ) { | |
pmpro_bp_redirect_to_access_required_page(); |
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
remove_filter( 'wp_mail_content_type', 'pmpro_wp_mail_content_type' ); |
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 | |
/** | |
* Load custom CSS on checkoutpage for specific membership level in Paid Memberships Pro. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function load_css_for_level_checkout(){ | |
global $pmpro_pages; |
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 | |
/** | |
* Copy the function below into your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* This function uses the gettext filter which will change all text occurences of Billing Address to Address in Paid Memberships Pro. | |
*/ | |
function change_text_billing_pmpro( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Billing Address' : | |
$translated_text = __( 'Address', 'paid-memberships-pro' ); | |
break; |
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 | |
/* | |
Plugin Name: PMPro Hidden Levels | |
Plugin URI: http://www.paidmembershipspro.com/pmpro-hidden-levels/ | |
Description: With this plugin, select levels are removed from the levels page but still available for checkout if you visit the checkout URL directly. | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ |