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 recipe adds a !!next_payment_date!! variable to your email templates. | |
* Note that this will only work with recurring levels and not for levels that expire or are once off. | |
* | |
* 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 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 | |
/** | |
* This recipe changes login page text strings with the gettext filter | |
* | |
* 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 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 member back to Addon Packages page after checkout. | |
* | |
* 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 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 | |
/** | |
* Send a welcome email to the member when creating a new user from the admin dashboard | |
* | |
* 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 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 | |
function mypmpro_enroll_on_new_course( $course_id, $post, $update ) { | |
global $wpdb; | |
if ( ! current_user_can( 'manage_options' ) ) { | |
return; | |
} |
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 | |
function mypmpro_remove_map_from_directory_page(){ | |
if( ! empty( $_REQUEST['ps'] ) ){ | |
remove_action( 'pmpro_member_directory_before', 'pmpromm_load_map_directory_page', 10, 2 ); | |
} | |
} | |
add_action( 'init', 'mypmpro_remove_map_from_directory_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 //do not copy | |
function mypmpro_ignore_discount_on_specific_products( $discount_price, $lowest_price_level, $price, $product ) { | |
//check if the product is in the array of product ids to ignore discount | |
$ignore_discount_on_products = array( 189 ); | |
if ( in_array( $product->get_id(), $ignore_discount_on_products ) ) { | |
return $price; | |
} else { | |
return $discount_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 | |
/** | |
* Generate a username at PMPro checkout from email for users. | |
* Hide your 'username' field using custom CSS. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_generate_username_at_checkout() { | |
// Make sure PMPro is installed and the function to get the level at checkout exists. |
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 | |
//add tax info to cost text. this is enabled if the danish checkbox is checked. | |
function customtax_pmpro_tax($tax, $values, $order){ | |
$tax = round( (float)$values['price'] * 0.20, 2 ); | |
return $tax; | |
} | |
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 | |
function my_pmprorh_init_pause_access() { | |
// Don't break if Register Helper is not loaded. | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
return false; | |
} | |
// Bail if not in administrative area. | |
if ( ! is_admin() ) { |
NewerOlder