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 | |
/** | |
* Add custom variables to PDF template editor to show some more order information. | |
* To add this code to your site, please visit - https://yoohooplugins.com/customize-wordpress/ | |
*/ | |
function my_pmpro_pdf_status_details( $data_array, $user, $order_data ) { | |
$data_array['{{order_status}}'] = esc_html( $order_data->status ); | |
return $data_array; | |
} | |
add_filter( 'pmpro_pdf_invoice_custom_variables', 'my_pmpro_pdf_status_details', 10, 3 ); |
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 | |
/** | |
* Move the Paid Memberships Pro content restricted message higher up in LifterLMS course content. | |
* This requires "Course Information" block to be on the page and shown before this using jQuery. | |
* Tweak this jQuery code to fit your needs and move the content higher up. | |
* | |
* To add the code to your site you may follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_move_pmpro_div_with_jquery_llms() { | |
?> |
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 | |
/** | |
* Adjust the login URL value that PMPro uses and override it to use a custom one. | |
* Use this to force the login URL even if the frontend URL page is set. | |
* You can tweak this further based on current page, condtionals and more. This is a starting point. | |
* To add this code to your site follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_login_url( $login_url, $redirect, $reauth ) { | |
$login_url = '/login'; // Change the slug of this. |
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 | |
/** | |
* Add 15% tax to all PMPro checkouts. | |
* Add this code to your site by visiting this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function customtax_pmpro_tax( $tax, $values, $order ) { | |
$tax = round((float)$values['price'] * 0.15, 2); | |
return $tax; | |
} | |
add_filter("pmpro_tax", "customtax_pmpro_tax", 10, 3); |
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 | |
/** | |
* Change the CCBill Sub Account for AddOn Package purchase. | |
* This can be tweaked further to change the subaccount (or any other argument) based on custom conditionals. | |
* | |
* REQUIRES PMPRO CCBILL 0.6+ | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_ccbill_change_sub_account( $ccbill_args, $order ) { | |
// Let's replace the subaccount when we get AddOn Package purchase. |
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 | |
/** | |
* Removes the email validation checks on the Edit Member and Frontend Edit Profile pages. | |
* This allows pending validation members to edit their own User Fields. | |
* This is only needed if the "Restrict Fields For Membership Levels" option is selected. | |
* | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_bypass_validation_frontend() { | |
global $pmpro_pages; |
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 | |
/** | |
* Require age verification before being able to signup for a membership level. | |
* Create a Date field in User Fields and rename the $dob_field_name and adjust the $min_age values. | |
* This supports PMPro V3.2+ and has backwards compatibility, please read the comments. | |
* | |
* To add this customization to your site, please follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_min_required_age( $okay ) { |
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 gist makes all the User Fields listed below in each if statement required. | |
* Only save the user's profile when all fields are submitted and not 0 values. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_make_profile_fields_required( &$errors, $update = null, &$user = null ) { | |
// Validate the custom User Fields. | |
if ( empty( $_REQUEST['last_name'] ) ) { |
NewerOlder