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() ) { |
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 PMPro to not track visits at all | |
* Add this code into a custom plugin or code snippet. | |
*/ | |
function my_pmpro_report_login_wp_visits_only_for_users() { | |
remove_action( 'wp', 'pmpro_report_login_wp_visits' ); | |
} | |
add_action( 'init', 'my_pmpro_report_login_wp_visits_only_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 | |
/** | |
* PMPro 3.1+ compatible | |
* Small jQuery snippet to move password field below email field for Paid Memberships Pro. | |
* Please note this will affect all instances such as Signup Shortcode, checkout page. | |
* To only load this on a specific page, please use the 'is_page' WordPress function in a condition. | |
*/ | |
function my_move_password_below_bemail() { | |
?> | |
<script> |
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 | |
/** | |
* Translates to No Access message strings. | |
* | |
* Follow this guide to add this code to your site: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
*/ | |
function pmpro_customizations_gettext($translated, $original, $domain) { |
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 would always show the renew link on the membership account page for the specified levels on line 13 | |
* Add the below code to your PMPro Customizations Plugin: | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
// always show renew links for certain levels if the member already has that level. |