From 637fa4f1aff93fd67fed77c0afc7baf589e12265 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 17 Sep 2013 08:33:10 +0000 Subject: [PATCH] Inline documentation for hooks in wp-admin/user-new.php. props bftrick. see #25229. Built from https://develop.svn.wordpress.org/trunk@25470 git-svn-id: http://core.svn.wordpress.org/trunk@25391 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/user-new.php | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php index ccae15ff26..273fa00a26 100644 --- a/wp-admin/user-new.php +++ b/wp-admin/user-new.php @@ -111,12 +111,19 @@ Please click the following link to confirm the invite: die(); } } else { - // Adding a new user to this blog + // Adding a new user to this site $user_details = wpmu_validate_user_signup( $_REQUEST[ 'user_login' ], $_REQUEST[ 'email' ] ); if ( is_wp_error( $user_details[ 'errors' ] ) && !empty( $user_details[ 'errors' ]->errors ) ) { $add_user_errors = $user_details[ 'errors' ]; } else { - $new_user_login = apply_filters('pre_user_login', sanitize_user(wp_unslash($_REQUEST['user_login']), true)); + /** + * Filter the user_login, aka the username, before it is added to the site. + * + * @since 3.0.0 + * + * @param string $_REQUEST['user_login'] The sanitized username. + */ + $new_user_login = apply_filters( 'pre_user_login', sanitize_user( wp_unslash( $_REQUEST['user_login'] ), true ) ); if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) { add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email } @@ -181,6 +188,13 @@ get_current_screen()->set_help_sidebar( wp_enqueue_script('wp-ajax-response'); wp_enqueue_script('user-profile'); +/** + * Allows you to enable user auto-complete for non-super admins in multisite. + * + * @since 3.4.0 + * + * @param bool True or false, based on if you enable auto-complete for non-super admins. Default is false. + */ if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' ) && ( is_super_admin() || apply_filters( 'autocomplete_users_for_site_admins', false ) ) ) { @@ -266,6 +280,13 @@ if ( is_multisite() ) { $label = __('E-mail or Username'); } ?> +
> @@ -299,6 +320,9 @@ if ( current_user_can( 'create_users') ) { echo '

' . __( 'Add New User' ) . '

'; ?>

+ > @@ -338,7 +362,15 @@ foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_nam - +