Plugin doesn’t delete users that are not in the list
-
We’ve a multisite installation of WordPress and I use Import users from CSV with meta to add and remove users on one of our sites.
The import works well but the plugin doesn’t remove users, that are no longer in the csv file.
I’ve changed a part in importer.php to:
// delete all users that have not been imported
if( $is_cron && get_option( “acui_cron_delete_users” ) ):
require_once( ABSPATH . ‘wp-admin/includes/user.php’);$all_users = get_users( array(
‘fields’ => array( ‘ID’ ),
‘role__not_in’ => array( ‘administrator’ )
) );
$cron_delete_users_assign_posts = get_option( “acui_cron_delete_users_assign_posts”);foreach ( $all_users as $user ) {
if( !in_array( $user->ID, $users_registered ) ){
if( ($user->ID != 1) && ($user->ID != 2) && ($user->ID != 3) && ($user->ID != 5) && ($user->ID != 6) && ($user->ID != 9) && ($user->ID != 10) && ($user->ID != 11) ){
wpmu_delete_user( $user->ID );
}
}
}
endif;Is there any problem I didn’t see?
Best regards
MiggiThe page I need help with: [log in to see the link]
- The topic ‘Plugin doesn’t delete users that are not in the list’ is closed to new replies.