Hot answers tagged user-registration
5
There are two ways to customize the default avatar:
Add a new default avatar to Settings/Discussion.
Change the output of get_avatar().
Let’s start with the first option; this processes slightly faster.
Add a new default avatar to Settings/Discussion
There is a filter 'avatar_defaults'. You can add more avatars here.
You get an array of default images ...
5
If wp_generate_password() was called with the third parameter $extra_special_chars = true a space might be part of the password:
function wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) {
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
if ( $special_chars )
$chars .= ...
4
The codex page for wp_insert_user() lists all the values that it accepts. comment_shortcuts, and show_admin_bar_front will all need to be set with update_user_meta().
To handle wp_user_level and wp_capabilities you will need to use WP_User.
You can use $new_user_user_id (long var name lol) for both WP_User and update_user_meta()
3
Basically, this is a programming pattern for namespacing code within a WordPress plugin. Typically, you can only have one function called init() in a program, but more than one author will try to use that name. Placing function names in a class is a way around this limitation.
For example:
class Towfiq_Person {
static function on_load() { }
...
3
The nicename is (usually) just a sanitized version of the username. It's suppose to be 'nice' in the sense that it is the 'nicename' that is used as a slug, for example:
www.yoursite.com/author/my-nice-name/
will take you to the archive of the author with nicename 'my-nice-name'.
The documentation simply describes it as
A string that contains a nicer ...
3
You can use user_register
add_action('user_register', 'wpse42506_user_register', 10, 3);
function wpse42506_user_register( $user_ID ) {
// do stuff here
}
If you want to just use the user information, you can use get_userdata
http://codex.wordpress.org/Function_Reference/get_userdata
If you need more control, you can initiate a new WP_User
...
3
You'll need three hooks:
1: user_register
This is for when the user is created via the admin back-end. The username will be available via $_POST['user_login'] and the password will be available via $_POST['pass1'].
2: edit_user_profile_update
This is for when the password is updated on the profile page by the user or admin. The username will be available ...
3
You're looking in the wrong place.
When a user first attempts to register, their username and email is processed and sanitized inside the register_new_user() function in wp-login.php. This is where you want to do your filtering.
Before the user is created, WordPress will pass the sanitized user login, email address, and an array or errors through the ...
3
This certainly can be done, but it requires some work. I am developing a pretty complex plugin for a client, and I plan to expand on it and make it available publicly when it is ready.
Telling you everything would take ages, so I will just give you some pointers on how you can achieve what you are aiming for.
Make a page called "Profile" and use a custom ...
3
Here is a function I've Used Before:
function registration_form_wpa95139(){
if (is_user_logged_in()) return;
?>
<div class="Registration">
<div id="register-form">
<div class="title">
<h1><?php _e('Register your Account'); ?></h1>
<span><?php ...
2
I had to implement this for a client site and ended up creating my own system.
I hash the email and date created timestamp and store it as a key in usermeta, then i email that key to the user's email in the form of a link. The link points to a page where I've created a rewrite rule and added my own query var so I can make nice site.com/authorize/{key} ...
2
Both modifying the fields and the styling of the user registration (as well as login, lost password, etc. pp.) page can be done programmatically as well as using plugins.
The latter obviously being the much simpler way of achieving quick results. While I'm all for control and doing things on our own, in this case there really is no need to, since excellent ...
2
Use wp_redirect() and admin_url() to redirect the user to his profile page if the custom buddypress user meta data isn't completely filled.
From another answer, I've seen that there's the following function: bp_get_profile_field_data(). So you can easily build a template tag, that gives you either the full buddy user meta data set, or simply a FALSE back.
...
2
I had the same need and created the following hack:
<?php
function hack_add_custom_user_profile_fields(){
global $pagenow;
# do this only in page user-new.php
if($pagenow !== 'user-new.php')
return;
# do this only if you can
if(!current_user_can('manage_options'))
return false;
?>
<table ...
2
What you are best off doing is hooking into user_register and from there updating the user options you want them set to. Below is an example of disabling the admin bar for new users:
add_action("user_register", "sc_set_user_admin_bar_false_by_default", 10, 1);
function sc_set_user_admin_bar_false_by_default($user_id) {
update_user_meta( $user_id, ...
2
The following untested code should get you started. Basically you add a display target on your form, add some javascript to add the validation when the user leaves the username field, and the server-side code to enqueue the javascript, and register the ajax actions.
Let me know what breaks, as I'm sure this will not run out of the box.
[!--HTML to add to ...
2
None. The whole source of wp_create_user() is:
function wp_create_user($username, $password, $email = '') {
$user_login = esc_sql( $username );
$user_email = esc_sql( $email );
$user_pass = $password;
$userdata = compact('user_login', 'user_email', 'user_pass');
return wp_insert_user($userdata);
}
It just calls insert version ...
2
While not a solution as such, I would suggest you send a couple of test emails to isolate the issue and verify how and where things go wrong. Perhaps your email is actually sent, but rejected by the remote mail server due to missing some headers etc. The code below might help you determine this. Temporarily put it in functions.php. wp_mail will return true ...
2
It's simple, use the function is_user_logged_in:
<?php if ( is_user_logged_in() ) { ?>
<a hef="link-for-logged-users"></a>
<?php } else { ?>
<a hef="link-for-users-not-logged-in"></a>
<?php } ?>
See here http://codex.wordpress.org/Function_Reference/is_user_logged_in
2
This is a small code I wrote to batch create generic users
<?php $lock = true; //true = disabled (locked)
if(!$lock) { // if not locked
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );
$last_registered_user = $wpdb->get_row("SELECT ID FROM $wpdb->users ORDER BY ID DESC LIMIT 1");
$new_id = $last_registered_user->ID + 1;
...
1
You can read a somewhat extensive tutorial over at:
http://www.cozmoslabs.com/1012-wordpress-user-registration-template-and-custom-user-profile-fields/
Basically this is what you're going to be using to add them to the backend:
add_action( 'show_user_profile', 'show_extra_profile_fields', 10 );
add_action( 'edit_user_profile', ...
1
Having done some research into Wordpress logins in the past, this is one of the few (possibly only?) tuts I could find where the author actually created a new login/register form.
http://digwp.com/2010/12/login-register-password-code/
Even so, he still uses the generic Wordpress wp-login.php code.
Re-coding the entire process is a big task. If you dig ...
1
Personally, I'd use the hook Register Form (run at the end of the default rego form) to capture the data then POST the data to a Drupal page and/or run the mysql query ond the Drupal database.
1
The technique is basically the same as in the case of wpmu_signup_user_notification().
function wpmu_welcome_user_notification($user_id, $password, $meta = '') {
global $current_site;
$welcome_email = get_site_option( 'welcome_user_email' );
$user = new WP_User($user_id);
$welcome_email = apply_filters( 'update_welcome_user_email', ...
1
To be able to do both - i.e. add something to the registration form AND have it editable from the admin side, you need to do 2 things.
The first, is add extra user meta (so you can see them from the admin side) and the second is to create a new registration template which hooks into WP's registration process.
There's a great tutorial at:
...
1
In another question of yours, you were pointed to the plugin WP Favorite Posts, but you seem to have settled with this premium one from Code Canyon.
So, the matter is how to integrate it with a Profile/Registration management plugin, and for that maybe Theme My Login would be a good candidate, as you can customize and add custom code to the following ...
1
1. Can you do it without a plugin?
Certainly. Anything a plugin can do, you can obviously also implement yourself.
1.1 Should you do it without a plugin?
No. This is clearly plugin-territory. Even if you want to write the plugin yourself, this would be a better fit for a custom plugin than to incorporate it in your theme. That's a matter of preference and ...
1
You can use the WP_User_Query class to query on user meta, however, your specific example of querying for a list of users with a join date matching a specific month and from any year requires a query more complex than what you can do out of the box with the WP_User_Query class.
First, it's important that the date format be correct and strictly enforced if ...
1
As a plugin all that I can give to you is this.
<?php
/*
Plugin Name: Users Table
Plugin URI: http://www.exe.ie
Description: A list of all available users with their ID, Name, Registration Date, Nickname, User Level and User Role
Version: 1.0
Author: Daniel Conde
Author URI: http://www.exe.ie
License: GPL
*/
add_action('admin_menu', ...
1
Take a look at the Transients API. It's meant to store data temporary. Note, that this doesn't replace a cron job, as it needs "Action" on the site. So if the site isn't requested, where you set/alter/delete a Transient, then nothing happens.
Only top voted, non community-wiki answers of a minimum length are eligible