Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/wp-admin/includes/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ function edit_user( $user_id = 0 ) {
$user_id = wp_update_user( $user );
} else {
$user_id = wp_insert_user( $user );
$notify = isset( $_POST['send_user_notification'] ) ? 'both' : 'admin';
if ( is_wp_error( $user_id ) ) {
return $user_id;
}
$notify = isset( $_POST['send_user_notification'] ) ? 'both' : 'admin';

/**
* Fires after a new user has been created.
Expand Down
4 changes: 4 additions & 0 deletions src/wp-includes/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,10 @@ function wp_insert_user( $userdata ) {
*/
$display_name = apply_filters( 'pre_user_display_name', $display_name );

if ( mb_strlen( $display_name ) > 250 ) {
return new WP_Error( 'user_display_name_too_long', __( 'Display name may not be longer than 250 characters.' ) );
}

$description = empty( $userdata['description'] ) ? '' : $userdata['description'];

/**
Expand Down
Loading