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 | |
function nua_allow_user_if_membership($errors) { | |
$allowed_memberships = array(123,321,789,987); // CHANGE THIS | |
if(!is_user_logged_in()) { | |
if(in_array((int)$_POST['mepr_product_id'], $allowed_memberships)) { | |
$_REQUEST['action'] = 'createuser'; //Set this so "New User Approve" plugin will not limit the subscriber | |
} | |
} |
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 | |
// Copy lines 4-6 below into a plugin like Code Snippets (run on front-end only) | |
add_filter('mp_elementor_include_section_html', function() { | |
return 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 | |
function plp_delay_message_code() { | |
?> | |
<p>Please wait... You will be redirected soon.</p> | |
<?php | |
} | |
add_action('prli-redirect-header', 'plp_delay_message_code'); |
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_filter('esaf_commission_percentages', function ($commission, $affiliate, $transaction) { | |
if($transaction) { | |
$user = get_user_by('email', $transaction->cust_email); | |
if($user && strtotime($user->user_registered) > strtotime($affiliate->user_registered)) { | |
$commission = array(30); | |
} | |
} |
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 | |
// Disables math captcha on login page | |
function kill_math_on_login() { | |
remove_all_actions('mepr-forgot-password-form'); | |
remove_all_actions('mepr-login-form-before-submit'); | |
remove_all_filters('mepr-validate-forgot-password'); | |
remove_all_filters('mepr-validate-login'); | |
} | |
add_action('plugins_loaded', 'kill_math_on_login'); |
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 | |
function force_business_vat_type($user) { | |
update_user_meta($user->ID, 'mepr_vat_customer_type', 'business'); | |
} | |
add_action('mepr-signup-user-loaded', 'force_business_vat_type'); |
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 | |
// Copy the lines below this one into a plugin like Code Snippets (run everywhere type) | |
function disable_admin_pw_changed_email_memberpress($recipients, $subject, $message, $headers) { | |
if(strpos($subject, 'Password Lost/Changed') !== false) { | |
$recipients = array(); // no recipients | |
} | |
return $recipients; | |
} | |
add_filter('mepr-wp-mail-recipients', 'disable_admin_pw_changed_email_memberpress', 11, 4); |
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 | |
// Replace admin email in password changed email | |
// We can replace all message or other params like | |
// ###USERNAME### or ###SITENAME### this way | |
add_filter('password_change_email', 'replace_admin_email_in_pass_email', 10, 3); | |
function replace_admin_email_in_pass_email($pass_change_email, $user, $userdata) { | |
$pass_change_email['message'] = str_replace( '###ADMIN_EMAIL###', '[email protected]', $pass_change_email['message'] ); | |
return $pass_change_email; | |
} |
NewerOlder