Created
March 5, 2020 15:08
-
-
Save ronalfy/2bc735b7658c7103b1b11b6ca247ea57 to your computer and use it in GitHub Desktop.
Paid Memberships Pro - Hide Membership Invite Code with Approvals Add On
This file contains hidden or 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 pmpro_invite_approval_message() { | |
if ( is_user_logged_in() ) { | |
global $current_user; | |
$user_id = $current_user->ID; | |
if ( ! PMPro_Approvals::isApproved( $user_id, 1 ) ) { // 1 is the membership level. | |
remove_filter( "pmpro_confirmation_message", "pmproio_pmpro_confirmation_message" ); | |
remove_filter('the_content', 'pmproio_the_content_account_page', 20, 1); | |
} | |
} | |
} | |
add_action( 'init', 'pmpro_invite_approval_message', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment