Skip to:
Content
Pages
Categories
Search
Top
Bottom

Dont send activation email but add activation_key meta

  • Profile photo of stupidchief
    stupidchief
    Member

    @stupidchief

    I’m trying to figure out a way to moderate new users (why is this not an option?)
    My solution is to not send activation emails automatically and then use a plugin that detects pending registrations and allows you to resend activation emails. that way admins can do some form of moderation.
    I have placed this in my functions.php

    
    function filter_no_activation_email() {
    
    global $wpdb;
    
    $user_id = $wpdb->get_var($wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_login = '%s'", $_POST ));
    $activation_key = wp_hash( $user_id  );
    update_user_meta( $user_id, 'activation_key', $activation_key );
    
    return false;
    }
    add_filter('bp_core_signup_send_activation_key', 'filter_no_activation_email');
    

    This seems to work but is there any other way to get $user_id without having to query the database?

    Or even better a plugin for moderation. looked around but there doesnt seem to be one

  • The topic ‘Dont send activation email but add activation_key meta’ is closed to new replies.