Display commenter’s registration date on comments?

In your wp_list_comments callback function, you can call get_userdata to get any additional comment author data: $userdata = get_userdata( $comment->user_id ); echo ‘Registered: ‘ . $userdata->user_registered; // format the date // Sunday January 13th 2013 echo ‘Registered: ‘ . date( ‘l F jS Y’, strtotime( $userdata->user_registered ) );

Adding extra info via GET while registeration in wordpress

I’ve recently written an affiliate plugin where i had to do pretty much the same stuff. Here’s a chopup of the relevant parts: To process the extra info you get from the registration form: add_action(‘user_register’, ‘my_handle_signup’, 10, 2); function my_handle_signup($user_id, $data = null) { $reg_ip = $_REQUEST[‘reg_ip’]; $referrer = $_REQUEST[‘referrer’]; if (isset($reg_ip) && isset($referrer)) { … Read more

Creating a Closed WordPress Community Using Referral Codes

So, first up, we need some sort of submit form. Here’s a simple one, it can be whatever you want, obviously. This is just for this example. Emails the person on submission and sets up a password key for them in the wp_options table. <?php add_action( ‘init’, ‘wpse15535_add_shortcode’ ); function wpse15535_add_shortcode() { add_shortcode( ‘invite-form’, ‘wpse15535_invite_form’ … Read more

Restrict user registration to emails on a single domain

You need to use delimiters in order for your regex to work. From the link above When using the PCRE functions, it is required that the pattern is enclosed by delimiters. A delimiter can be any non-alphanumeric, non-backslash, non-whitespace character. so in your case, you could have something like this. Notice how I used the … Read more

How to add a description to the user name input field in the registration form?

OK, that’s possible using JavaScript (jQuery lib). Code – // load jquery on login screen if not loaded already add_action( ‘login_enqueue_scripts’, ‘wpse_login_head’ ); function wpse_login_head(){ wp_enqueue_script(‘jquery’); } add_action( ‘register_form’, ‘wpse_register_form’ ); function wpse_register_form(){ ?> <!– we have used an unique id for the description tag –> <span id=”user_login_description” style=” display:none;” class=”description”><?php _e(“Description text”); ?></span> <!– … Read more

Advice on setting up a site with front end registration

It’s few months already and you probably have this solved by now but I’ll try to do a little necromancing resume here anyway. We don’t like unanswered questions right? 😉 There’s a recent topic dealing with the front-end login & registration: Front-end Register Form You can change what WordPress displays to the users based on … Read more

Is there a way to set the user Role based on email domain

With this code, you will check during the registration the users email and attach the roles you want to: <?php add_action( ‘user_register’, ‘wp234_set_role_by_email’ ); function wp234_set_role_by_email( $user_id ){ $user = get_user_by( ‘id’, $user_id ); $domain = substr( strrchr( $user->data->user_email, “@” ), 1 ); //Get Domain $contributor_domains = array( ‘gmail.com’ ); if( in_array( $domain, $contributor_domains ) … Read more

500 Internal Server Error after Register dialog, but with successful registration

Internal Server errors are usually thrown when there’s an error somewhere in the code. You did the right thing searching the logs, but depending on your hosting configuration not all errors can be written there. I like using WordPress’s own logging facility. Here’s what you need to do: Stick the following lines in your wp-config.php … Read more

Auto Delete Users (auto_delete_users)

You do not need to use raw SQL, WordPress already provides WP_User_Query, and even provides examples of date based queries, for example the official docs say that this will retrieve all users registered within the last 12 hours: $args = array( ‘date_query’ => array( array( ‘after’ => ’12 hours ago’, ‘inclusive’ => true ) ) … Read more