New users must comment when requesting username

You can use a captcha plugin that requires users to type a short phrase or random letters in order to register on your site. An example of one of these plugins is the WP-reCAPTCHA, found at: http://wordpress.org/extend/plugins/wp-recaptcha/ Or you can use a plugin such as CIMY User Extra Fields to add fields to a user … Read more

User ability to favorite or ‘like’ content

You might have already thought of this, but have you thought about a plugin. I was sure that the WPMU Dev guys did one that did a like (that wasn’t FB related) but I can’t find it (if you want to look it must be somewhere here but I’ve gone through it all and I … Read more

In administration, how do I display comments of a certain user?

Afaik, there’s no straight forward way for this. You’d have to extend the WP_List_Table and add an extra column. This would be an example function: function wpse_get_comments_by_user( $user_ID ) { global $wpdb; $rows = $wpdb->query( $wpdb->prepare( ” SELECT * FROM %s WHERE user_id = %d ” ,$wpdb->comments ,(int) $user_ID ) ); return $rows; } The … Read more

How to expire all wordpress user passwords instantly?

Some underlying functionality borrowed from http://wordpress.org/extend/plugins/auto-expire-passwords/ , and tweaked. Untested, but along the lines of what you are looking for, so YMMV. function custom_forced_password_reset( $user ) { update_user_meta( $user->ID, ‘password_was_force_reset’, true ); } add_action( ‘password_reset’, ‘custom_forced_password_reset’ ); // Ensure all new register users have the flag set function custom_forced_password_user_register($user_id){ update_user_meta( $user_id, ‘password_was_force_reset’, true ); } … Read more

Custom style on profile options page

It works on a standard profile page (your profile / Profile) without other plugins installed. Other plugins may affect the overall result. I think code can be improved, if some one knows how please give it a go. function better_profile_page($buffer) { global $pagenow; if ($pagenow == ‘profile.php’ || $pagenow == ‘users.php’ || $pagenow == ‘user-edit.php’) … Read more

Custom user profile URLs

Create an endpoint for EP_ROOT named profile. In your callback handler use get_user_by( ‘slug’, get_query_var( ‘profile’ ) ) to find the user data. Create a template file profile.php and use locate_template( ‘profile.php’, TRUE ) to load it. In your template show the user data.

WPMU – new users are automatically subscribed to the main blog – how to prevent that?

This is a known bug. A fix will be available in 3.6.1, see: http://core.trac.wordpress.org/ticket/25166 For now, either bulk remove the users in WP Admin or do something (ugly and temporary, remove when 3.6.1 is available) like: add_action( ‘wpmu_new_user’, function ( $user_id ) { global $current_site; remove_user_from_blog( $user_id, $current_site->blog_id ); // remove user from main blog. … Read more

Create dropdown of users in admin dashboard

wp_dropdown_users accept for show arguments only field from the users table, not from user_meta table. If you enable debug, with your code, using ‘companyname’ for $show argument you will see something like: WordPress database error: [Unknown column ‘wp_users.companyname’ in ‘field list’] SELECT wp_users.ID,wp_users.user_login,wp_users.companyname FROM wp_users WHERE 1=1 ORDER BY display_name ASC So, solution is create … Read more

Generating User(s) with Settings API

You are using add_settings_field wrong: the function sl_wp_create_user is being passed as $args (and you probably don’t need any args), and it should be the sanitize callback for register_settings. Make the input like: function sl_render_users_input() { echo ‘<input id=”num_users[value]” name=”num_users[value]” type=”input” value=”” />’; } And the sanitize function: function sl_wp_create_user( $input ) { if( isset( … Read more