Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
@MaryOJob
MaryOJob / mycustom_confirmation.html
Created August 30, 2021 11:30 — forked from gausam/mycustom_confirmation.html
Send additional custom confirmation email
<h3>Lorem Isupm, !!display_name!!</h3>
<p>Any content can be added here.</p>
<p>Please see the <i>Variable Reference</i> at https://www.paidmembershipspro.com/add-ons/email-templates-admin-editor/</p>
<p>Account: !!display_name!! (!!user_email!!)</p>
<p>Log in to your membership account here: !!login_link!!</p>
<?php //do not copy
/**
* This recipe update the level cost text based on the Country selected. This recipe will work
* with the VAT Tax Add On for EU customers.
*
* 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/
@JarrydLong
JarrydLong / pmpro-tax-filter-states-province.php
Last active January 4, 2022 13:55 — forked from andrewlimaza/pmpro-tax-filter-states-province.php
Custom Tax Structure For Paid Memberships Pro for States/Provinces.
<?php
/**
* This recipe will add tax based on the different Canadian regions.
*
* 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/
*/
function my_pmpro_custom_canada_tax( $tax, $values, $order ) {
<?php
/**
* This recipe will geocode the members based on their user account only.
* Run /wp-admin/?pmpromm_process_users=true to run the script.
*
* 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/
*/
<?php
/**
* This recipe will add a Restrict field to each discount code. You can then restrict the use of a discount code
* when a user is logged in.
*
* 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/
*/
@andrewlimaza
andrewlimaza / mmpu-woocommerce-enable.php
Created April 29, 2021 11:46
Allow user's to hold multiple levels with MMPU and WooCommerce for Paid Memberships Pro.
<?php
/**
* This allows user's to have multiple levels when purchasing via WooCommerce.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
add_filter( 'pmprowoo_mmpu_force_add_level', '__return_true' );
@andrewlimaza
andrewlimaza / dynamic-read-only-field-type-rh-pmpro.php
Last active May 6, 2021 08:23
dynamic readonly example for Register Helper
<?php
/**
* Make read-only set to true for non-admins.
* This is a template, please copy code over that is needed for your own integrations.
* Follow this guide to add custom code to your membership site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmprorh_init() {
// Don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
@andrewlimaza
andrewlimaza / pmpro-checkout-compatibility-wpml.php
Last active March 12, 2024 10:38
WPML Compatibility for Paid Memberships Pro Checkout.
<?php
/**
* Adds support for plugins like WPML that create pages for translation.
* Improves the pmpro_is_checkout() calls to try and make it 'smarter'.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_wpml_checkout_compat( $is_checkout ) {
// If we're already on checkout, just bail.
@andrewlimaza
andrewlimaza / change-expiration-until-cancelled.php
Created April 12, 2021 07:47
Change Expiration Text From "---" to "Until Cancelled"
<?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 === '---' ) {
$expiration_text = __( 'Until Cancelled', 'paid-memberships-pro' );
}
@dparker1005
dparker1005 / my_pmpro_confirmation_message_not_success.php
Last active May 10, 2021 08:57
Remove the text "Your %s membership is now active" from confirmation message if order does not have "success" status.
<?php
// Copy from below here...
/*
* Remove the text "Your %s membership is now active" from confirmation message
* if order does not have "success" status.
*
* 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.