Forums

New User Approve
[resolved] Denied users still accepted as default role (10 posts)

  1. threesongbirds
    Member
    Posted 9 months ago #

    It's not a big deal because they will never receive their password to the site, but they still show up under "All users" despite being denied.
    I don't know if this is something that can be fixed or needs to, but didn't see this issue anywhere so I thought I'd say it.

    Thanks for the great plug in, works perfectly on 3.4.1 :)

    http://wordpress.org/extend/plugins/new-user-approve/

  2. nicolaelvin
    Member
    Posted 8 months ago #

    yes I need the user then to be deleted. If this plugin can't do it, I might look into another one.

  3. Tevya
    Member
    Posted 7 months ago #

    I haven't tested, but if this is normal, it would be preferable to completely remove denied users from the system. Unless there's some way to go back and approve them after this, there's no reason to keep their data in the database.

  4. Josh Harrison
    Member
    Plugin Author

    Posted 7 months ago #

    There is now a hook that now allows you to add anything to the deny or add actions. http://wordpress.org/extend/plugins/new-user-approve/other_notes/

  5. cordigital
    Member
    Posted 3 months ago #

    How would one go about using one of these hooks?

    How do I create the action of DELETE the denied users?

    It still appears in the user list, the forums subscibers, everywhere. I must have them deleted upon denial.

  6. Andy Fragen
    Member
    Posted 1 month ago #

    Is there any way to get an example of deleting the user with the hook.

    I've tried the following but it doesn't seem to work.

    add_action( 'new_user_approve_user_denied', 't262_delete_user' );
    
    function t262_delete_user ( $user_id ) {
    	global $wpdb;
    	require_once( '../wp-admin/includes/user.php');
    	wp_delete_user( $user_id );
    }

    This code is located in my theme's functions.php file.

    TIA

  7. Andy Fragen
    Member
    Posted 1 month ago #

    OK, here's what I've got that works.

    add_action( 'new_user_approve_user_denied', 't262_delete_user' );
    function t262_delete_user ( $user ) {
    	global $wpdb;
    	require_once( ABSPATH . '/wp-admin/includes/user.php');
    	wp_delete_user( $user->ID );
    }

    I'm tempted to role it up into a plugin. Anyone interested?

  8. Shubham Vijay
    Member
    Posted 2 days ago #

    @Anty Fragen, thanks for your code ,its working :)

  9. Tevya
    Member
    Posted 2 days ago #

    I'd be interested in a plugin. Or an update to this plugin, that includes that as an option (checkbox?).

  10. Andy Fragen
    Member
    Posted 1 day ago #

    Here's a plugin that checks to see if New User Approve is loaded and will delete a denied user. Download, drop into plugin directory and activate. Alternately you can download, zip and add new.

    https://gist.github.com/afragen/5624319

    Feedback welcome.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.