@deebalturk
I tried to find the meta_key for your User status in ER Forms
and found this where it’s a meta_key active which is 0 for an inactive user.
https://plugins.svn.ww.wp.xz.cn/easy-registration-forms/trunk/includes/class-user.php
If this is true, you can try this code snippet which will make all inactive ER Forms Users UM inactive too. The User status update will be made when you display an UM page.
After the update remove the code snippet.
add_action( 'init', 'update_er_forms_inactive_users' );
function update_er_forms_inactive_users() {
$inactive_users = get_users( array( 'meta_key' => 'active',
'meta_value' => '0',
'fields' => 'user_id',
));
foreach( $inactive_users as $inactive_user ) {
update_user_meta( $inactive_user, 'account_status', 'inactive' );
UM()->user()->remove_cache( $inactive_user );
}
}
Install the code snippet into your active theme’s functions.php file
or use the “Code Snippets” plugin.
https://ww.wp.xz.cn/plugins/code-snippets/
thank you i will try it and get back to you
@deebalturk
Yes you are right, replace the code snippet with this updated code snippet.
add_action( 'init', 'update_er_forms_inactive_users' );
function update_er_forms_inactive_users() {
$inactive_users = get_users( array( 'meta_key' => 'erf_active',
'meta_value' => '0',
'fields' => 'user_id',
));
foreach( $inactive_users as $inactive_user ) {
update_user_meta( $inactive_user, 'account_status', 'inactive' );
UM()->user()->remove_cache( $inactive_user );
}
}
Hi @deebalturk
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂
Regards