• Resolved luxman

    (@luxman)


    I approved a member but how can I put them back to pending?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    Just replied to your other thread.

    Another function to use. Pass in the user ID you want to set to moderated, as the first parameter. The second parameter can be used to also set them as NOT moderated, but if you pass nothing for it, it’ll mark them as moderated.

    // Our admin should be moderated!
    bp_registration_set_moderation_status( 1 );
    
    // Ok, that was a bad idea, let's not moderate them.
    bp_registration_set_moderation_status( 1, 'false' );
    
    /**
     * Update our moderation status for a user.
     *
     * @since 4.2.0
     *
     * @param int    $user_id User ID to update.
     * @param string $status   Value to update the user meta to.
     * @return int Meta row ID that got updated.
     */
    function bp_registration_set_moderation_status( $user_id = 0, $status = 'true' ) {
    	$user = get_userdata( $user_id );
    
    	if ( ! $user ) {
    		return false;
    	}
    
    	delete_user_meta( $user_id, '_bprwg_is_moderated' );
    	return update_user_meta( absint( $user_id ), '_bprwg_is_moderated', $status );
    }
    
    Thread Starter luxman

    (@luxman)

    Would be great to go into the Admin backend > users > then recheck “Approve” or something to freeze the users account until approved again. Trying to do that now.

    Thread Starter luxman

    (@luxman)

    Where do I place the function above to make it so user with the id 20 has to be approved again?

    got it

    • This reply was modified 6 years ago by luxman.
    Michael Beckwith

    (@tw2113)

    The BenchPresser

    The function calls would go wherever/whenever you’re doing things to set a new status. The function declaration is already in our plugin and shouldn’t need to be re-defined. Is this a one-off thing or are you going to be doing this regularly?

    Regarding UI options, we’ve had it listed as an enhancement idea at https://github.com/WebDevStudios/BuddyPress-Registration-Options/issues/100 but we haven’t done anything with it quite yet. We haven’t been in a lot of active development for new features.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Place User Back into Pending?’ is closed to new replies.