[wp-hackers] "commenter" user role

Dougal Campbell dougal at gunters.org
Thu Mar 11 03:12:51 UTC 2010

On Mar 10 2010 2:52 PM, Otto wrote:
> On Wed, Mar 10, 2010 at 1:27 PM, Jeremy Clarke<jer at simianuprising.com>  wrote:
>> If you think that the current system for doing this is clunky then you
>> should work on improvements to the current system. I'd love it there
>> was a built-in way to set up your comment form in such a way that it
>> basically signs people up for accounts by default, without seeing the
>> admin. That might be plugin territory or not, but there's no reason to
>> believe that changing the DB structure will improve it inherently.
> It's actually not that hard to do as a plugin.
> add_action to pre_comment_on_post. That function looks at the
> submitted email value, then calls get_user_by_email to see if the user
> has already registered or not. If not, it can add him using
> wp_insert_user and the submitted values. Then it will need to call
> wp_set_current_user() to make the user "logged in". After that, the
> normal comment handling code will automatically fill in the user_ID
> field.
> Should be no more than, say, 15-20 lines of code.

Sure, but... What do you do about the password/authentication? Are you 
going to email the user to inform him that he's got an account and give 
him a password? If not, then what happens when he clears his cookies and 
revisits the site? Do you just assume that any shmoe who enters that 
email address is the right person?

And maybe I missed the part where somebody enumerated what the actual 
advantages to such a change might be? Because I just don't see it. What 
problem would we actually be solving by merging commenters into the 
users table? And to repeat what's already been said: and how is this 
problem not already solved by turning on "must register to comment", and 
the existing Subscriber role?

Dougal Campbell <dougal at gunters.org>

More information about the wp-hackers mailing list