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 | |
/** | |
* Allow non-members to view restricted posts if they are less than 30 days old. | |
* Change the '-30 Days' below if you'd like to allow access for longer or shorter. | |
* Adjust $categories array for the categories this should apply to. | |
* Add this code to your Customizations Plugin by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function open_new_posts_to_non_members($hasaccess, $thepost, $theuser, $post_membership_levels) { | |
global $wpdb; |
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 if(!defined('ABSPATH')) {die('You are not allowed to call this page directly.');} ?> | |
<?php do_action('mepr-above-checkout-form', $product->ID); ?> | |
<div class="mp_wrapper"> | |
<form class="mepr-signup-form mepr-form" method="post" action="<?php echo $_SERVER['REQUEST_URI'].'#mepr_jump'; ?>" enctype="multipart/form-data" novalidate> | |
<input type="hidden" name="mepr_process_signup_form" value="<?php echo isset($_GET['mepr_process_signup_form']) ? esc_attr($_GET['mepr_process_signup_form']) : 1 ?>" /> | |
<input type="hidden" name="mepr_product_id" value="<?php echo esc_attr($product->ID); ?>" /> | |
<input type="hidden" name="mepr_transaction_id" value="<?php echo isset($_GET['mepr_transaction_id']) ? esc_attr($_GET['mepr_transaction_id']) : ""; ?>" /> |
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; | |
} |