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 | |
/** | |
* Load custom CSS only for levels 2 or 8 at checkout. Tweak the array value for your level ID's | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_load_css_per_level() { | |
if ( ! function_exists( 'pmpro_getLevelAtCheckout' ) ) { | |
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 | |
/** | |
* Creates and adds !!title!! and !!surname!! email variables to use in email templates. | |
* Supports Paid Memberships Pro V3.0+ | |
* To add this code to your site, please follow this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_add_custom_variables( $data, $email ) { | |
global $current_user; | |
// Is the emails for admins? If so, let's get the user ID from elsewhere (currently logged in or whoever the email is being sent to) |
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 "Choose a membership level" wording on the Paid Memberships Pro account page. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_account_page_gettext_changes( $translated, $text, $domain ) { | |
switch ( $domain ) { | |
case 'paid-memberships-pro': | |
switch ( $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 | |
/** | |
* Make the "More Information" container for custom fields 2 columns at Paid Memberships Pro checkout. | |
* Tweak the code below to work for your needs and any other field group you may have. | |
* Follow this guide to add custom code to your WordPress site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_custom_add_jquery_script() { | |
?> | |
<script type="text/javascript"> |
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 'is_renewal' to the data load sent to Zapier when using the New Order trigger for PMPro Zapier Add On. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_add_custom_field_added_order( $data, $order, $user_id ) { | |
if ( $order->is_renewal() ) { | |
$data['is_renewal'] = true; | |
} else { | |
$data['is_renewal'] = false; |
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 | |
/** | |
* Remove Paid Memberships Pro select2 from the GamiPress Leaderboard settings pages. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_custom_dequeue_select2() { | |
if ( isset( $_REQUEST['post_type'] ) && 'gp_leaderboard' == $_REQUEST['post_type'] ) { | |
wp_dequeue_script( 'select2' ); | |
wp_deregister_script( 'select2' ); | |
} |
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 | |
/** | |
* Tweak the user capability required to view the When Last Login - User Statistics charts/reporting. | |
* This requires V1.1+ of When Last Login - User Statistics. | |
* Add this code to your site by following this guide - https://yoohooplugins.com/customize-wordpress/ | |
*/ | |
function my_wll_user_stats_admin_cap( $capability ) { | |
return 'edit_users'; // Change this to the custom capability value. | |
} | |
add_filter( 'wll_stats_access_cap', 'my_wll_user_stats_admin_cap', 10, 1 ); |
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 | |
/** | |
* Remove select2.js and select2.css on non-pmpro pages to prevent conflicts within the WordPress admin. | |
* Only use this if you are 100% certain that the conflict is due to select2 being loaded more than once. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_custom_dequeue_select2() { | |
// Bail if we're on PMPro pages, but remove select2 from all other admin pages. | |
if ( ! empty( $_REQUEST['page'] ) && strpos( $_REQUEST['page'], 'pmpro' ) !== false ) { |
NewerOlder