pmpro_admin_access_override administrator have access to every page

function pmpro_admin_access_override($hasaccess, $post, $user, $levels) { // Check if the current user has the ‘administrator’ role if (current_user_can(‘administrator’)) { // Grant access return true; } // Return the original access decision for non-admins return $hasaccess; } add_filter(‘pmpro_has_membership_access_filter’, ‘pmpro_admin_access_override’, 10, 4);Continue reading

Filter the settings of email frequency sent

/** * Filter the settings of email frequency sent when using the Extra Expiration Warning Emails Add On * https://www.paidmembershipspro.com/add-ons/extra-expiration-warning-emails-add-on/ * * Update the $settings array to your list of number of days => ”. * Read the Add On…Continue reading

Remove old roles on membership upgrade

add_action( ‘pmpro_after_change_membership_level’, ‘remove_old_roles_on_membership_upgrade’, 10, 2 ); function remove_old_roles_on_membership_upgrade( $level_id, $user_id ) { // Get the user’s current roles $user = new WP_User( $user_id ); $current_roles = $user->roles; // Define your membership level to role mapping $membership_roles = array( ‘1’ =>…Continue reading