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
<style> | |
@media only screen and (min-width: 1200px) { | |
#pmpro_form h3 { | |
display: grid; | |
grid-template-columns: 2fr 1fr; | |
} | |
.pmpro_checkout .pmpro_checkout-fields .pmpro_checkout-field { | |
clear: left; | |
} | |
.pmpro_checkout .pmpro_checkout-fields .pmpro_checkout-field label { |
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
/* | |
Stop users from setting their username to an email address | |
Add this code to a custom plugin. | |
*/ | |
function pmpro_registration_checks_no_email_user_login($continue) { | |
//if there are earlier problems, don't bother checking | |
if(!$continue) | |
return; | |
//make sure the username passed in doesn't look like an email address (contains a @) |
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: Paid Memberships Pro - South Africa VAT | |
Plugin URI: TBA | |
Description: Apply South Africa VAT to Checkouts with PMPro | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ | |
/* |
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 | |
/** | |
* Allows non-members to read comments on restricted posts. | |
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function make_pmpro_comments_open() { | |
remove_filter( 'comments_array', 'pmpro_comments_filter', 10, 2 ); | |
} | |
add_action( 'init', 'make_pmpro_comments_open' ); |
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 a member for first time login. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* www.paidmembershipspro.com | |
*/ | |
function first_time_login_redirect( $redirect_to, $request, $user ) { | |
//check level | |
if ( ! empty( $user ) && ! empty( $user->ID ) && function_exists( 'pmpro_getMembershipLevelForUser' ) ) { |
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 | |
/** | |
* Stop non-members from purchasing products if they do not have an active Paid Memberships Pro Level. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function stop_non_pmpro_members_from_buying_woo( $is_purchasable, $product ) { | |
// Check if the user has an active membership level. |
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 | |
/** | |
* Remove the replacement homepage from the Member HomePages Add On for Paid Memberships Pro. | |
* | |
* Add this code (L7-L12 only) to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function remove_member_homepages_redirect(){ | |
if ( current_user_can( 'manage_options' ) ) { | |
remove_action( 'template_redirect', 'pmpromh_template_redirect_homepage' ); | |
} |
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 adjust membership pricing depending on users current level and level checking out for. See line 10. | |
* This will show you how to adjust the initial amount and/or the recurring amount. If the existing level, in this case 2, is not a recurring level please uncomment lines 12-14. | |
* Add this code (L8 - L20) to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_adjust_price_for_members( $level ) { | |
// Adjust price for existing members that currently have Membership level id 1 and are upgrading to Membership Level id 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
// Change 'Membership' to 'Subscription' for Paid Memberships Pro. | |
function my_gettext_membership( $translated_text, $text, $domain ) { | |
if( "paid-memberships-pro" == $domain ) { | |
$translated_text = str_replace( "Membership Level", "Subscription", $translated_text ); | |
$translated_text = str_replace( "membership level", "subscription", $translated_text ); | |
$translated_text = str_replace( "membership", "subscription", $translated_text ); | |
$translated_text = str_replace( "Membership", "Subscription", $translated_text ); | |
} | |
return $translated_text; | |
} |
OlderNewer