- added hot checking membership when rejected user is logged in - logout it;

This commit is contained in:
nikitozzzzzzz
2018-01-19 12:50:54 +02:00
parent 519372cb33
commit ec807386af
2 changed files with 22 additions and 3 deletions
+4 -3
View File
@@ -37,9 +37,10 @@ if ( ! class_exists( 'Admin_Notices' ) ) {
}
/***
*** @show main notices
***/
/**
* Show main notices
*/
function main_notices() {
if ( ! defined( 'DOING_AJAX' ) ) {
+18
View File
@@ -70,9 +70,27 @@ if ( ! class_exists( 'User' ) ) {
add_action( 'added_existing_user', array( &$this, 'add_um_role_existing_user' ), 10, 2 );
add_action( 'wpmu_activate_user', array( &$this, 'add_um_role_wpmu_new_user' ), 10, 1 );
add_action( 'init', array( &$this, 'check_membership' ), 10 );
}
function check_membership() {
if ( ! is_user_logged_in() )
return;
um_fetch_user( get_current_user_id() );
$status = um_user( 'account_status' );
if ( 'rejected' == $status ) {
wp_logout();
exit( wp_redirect( um_get_core_page( 'login' ) ) );
}
um_reset_user();
}
/**
* Multisite add existing user
*