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; | |
} |
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 // Do not copy this tag. | |
/** | |
* Replace all spaces with an underscore when new users register for Paid Memberships Pro. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_custom_user_registration_changes( $userdata ) { | |
$userdata['user_login'] = str_replace(' ', '_', $userdata['user_login'] ); |
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 //Do not copy this tag. | |
// Copy the function below into your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
// Use the shortcode [membership_level] to display the user's current membership level. | |
function pmpro_membership_level_shortcode( $atts ){ | |
if(is_user_logged_in() && function_exists( 'pmpro_hasMembershipLevel' ) && pmpro_hasMembershipLevel()){ | |
global $current_user; | |
$current_user->membership_level = pmpro_getMembershipLevelForUser($current_user->ID); | |
return sprintf(__( "Your current level is: %s", "pmpro" ), $current_user->membership_level->name); |
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 | |
/** | |
* Display messages of the Original Price, Discounted Price and Amount Saved when discount code is applied to PMPro order. | |
* Add this code recipe to a PMPro Customization Plugin - Display messages of the Original Price, Discounted Price and Amount Saved when discount code is applied to PMPro order | |
* Various classes added to strings to allow for styling - ".pmpro-discorig-message", ".pmpro-orginal-price", ".pmpro-discount-price", ".pmpro-save-price" | |
* | |
* [my_pmpro_applydiscountcode_return_js] Display original price and discount when a discount code is applied. | |
* @param string $discount_code [description] | |
* @param integer $discount_code_id [description] |
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 | |
/** | |
* Show next payment date under 'Expiration' field in PMPro account page. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Works for PayPal Express and Stripe payment gateways. | |
* www.paidmembershipspro.com | |
*/ | |
// Change the expiration text to show the next payment date instead of the expiration date | |
// This hook is setup in the wp_renewal_dates_setup function below | |
function my_pmpro_expiration_text($expiration_text) { |
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 | |
/* | |
* Example of Register Helper fields. Code is incomplete. For complete coding solution, please see: https://www.paidmembershipspro.com/documentation/register-helper-documentation/code-examples/ | |
* | |
*/ | |
// Define the fields. | |
$fields = array(); | |
$fields[] = new PMProRH_Field( | |
'company', // input name, will also be used as meta key |
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 | |
/** | |
* Requires Paid Memberships Pro and the PMPro Register Helper Add On(https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/) to be installed and activated in order to work | |
* Please only add this script if you have previously added a custom field to your Register Helper and you need to add another field. | |
*/ | |
$fields[] = new PMProRH_Field( | |
'field_name', // input name, will also be used as meta key | |
'text', // type of field |
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 | |
/** | |
* This will generate information for username, password and password 2. This is great for free levels. | |
* Adjust the $generate_data_level ID's to allow data generation for specific levels. | |
* Use CSS to hide these fields on the checkout page from the frontend. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
// Function to make fields optional for free levels. | |
function my_generate_fields_for_users() { |
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 | |
function my_init_email_as_username() | |
{ | |
//check for level as well to make sure we're on checkout page | |
if(empty($_REQUEST['level'])) | |
return; | |
if(!empty($_REQUEST['bemail'])) | |
$_REQUEST['username'] = $_REQUEST['bemail']; | |
OlderNewer