Make WordPress Core

Ticket #25229: user-new.3.diff

File user-new.3.diff, 2.8 KB (added by bftrick, 11 years ago)

third pass of user-new.php

  • wp-admin/user-new.php

     
    116116                if ( is_wp_error( $user_details[ 'errors' ] ) && !empty( $user_details[ 'errors' ]->errors ) ) {
    117117                        $add_user_errors = $user_details[ 'errors' ];
    118118                } else {
     119                        /**
     120                         * Filter the user_login (aka the username).
     121                         *
     122                         * @since Unknown
     123                         *
     124                         * @param string $_REQUEST['user_login'] The sanitized username.
     125                         */
    119126                        $new_user_login = apply_filters('pre_user_login', sanitize_user(wp_unslash($_REQUEST['user_login']), true));
    120127                        if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) {
    121128                                add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email
     
    181188wp_enqueue_script('wp-ajax-response');
    182189wp_enqueue_script('user-profile');
    183190
     191/**
     192 * Allows you to enable user auto-complete for non-super admins in multisite.
     193 *
     194 * @since 3.4
     195 *
     196 * @param bool True or false, based on if you enable auto-complete for non-super admins. Default is false.
     197 */
    184198if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' )
    185199        && ( is_super_admin() || apply_filters( 'autocomplete_users_for_site_admins', false ) )
    186200) {
     
    266280                $label = __('E-mail or Username');
    267281        }
    268282?>
     283<?php
     284/**
     285 * Fires inside the adduser form tag.
     286 *
     287 * @since Unknown
     288 */
     289?>
    269290<form action="" method="post" name="adduser" id="adduser" class="validate"<?php do_action('user_new_form_tag');?>>
    270291<input name="action" type="hidden" value="adduser" />
    271292<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
     
    299320                echo '<h3 id="create-new-user">' . __( 'Add New User' ) . '</h3>';
    300321?>
    301322<p><?php _e('Create a brand new user and add them to this site.'); ?></p>
     323<?php
     324//duplicate_hook
     325?>
    302326<form action="" method="post" name="createuser" id="createuser" class="validate"<?php do_action('user_new_form_tag');?>>
    303327<input name="action" type="hidden" value="createuser" />
    304328<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ) ?>
     
    338362                <th scope="row"><label for="url"><?php _e('Website') ?></label></th>
    339363                <td><input name="url" type="text" id="url" class="code" value="<?php echo esc_attr($new_user_uri); ?>" /></td>
    340364        </tr>
    341 <?php if ( apply_filters('show_password_fields', true) ) : ?>
     365<?php
     366/**
     367 * Filter the display of the password fields.
     368 *
     369 * @since Unknown
     370 *
     371 * @param bool True or false, based on if you want to show the password fields. Default is true.
     372 */
     373if ( apply_filters('show_password_fields', true) ) : ?>
    342374        <tr class="form-field form-required">
    343375                <th scope="row"><label for="pass1"><?php _e('Password'); ?> <span class="description"><?php /* translators: password input field */_e('(required)'); ?></span></label></th>
    344376                <td>