Make WordPress Core

Changeset 25470


Ignore:
Timestamp:
09/17/2013 08:32:07 AM (11 years ago)
Author:
SergeyBiryukov
Message:

Inline documentation for hooks in wp-admin/user-new.php.

props bftrick.
see #25229.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-new.php

    r24992 r25470  
    112112        }
    113113    } else {
    114         // Adding a new user to this blog
     114        // Adding a new user to this site
    115115        $user_details = wpmu_validate_user_signup( $_REQUEST[ 'user_login' ], $_REQUEST[ 'email' ] );
    116116        if ( is_wp_error( $user_details[ 'errors' ] ) && !empty( $user_details[ 'errors' ]->errors ) ) {
    117117            $add_user_errors = $user_details[ 'errors' ];
    118118        } else {
    119             $new_user_login = apply_filters('pre_user_login', sanitize_user(wp_unslash($_REQUEST['user_login']), true));
     119            /**
     120             * Filter the user_login, aka the username, before it is added to the site.
     121             *
     122             * @since 3.0.0
     123             *
     124             * @param string $_REQUEST['user_login'] The sanitized username.
     125             */
     126            $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
     
    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.0
     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 ) )
     
    267281    }
    268282?>
     283<?php
     284/**
     285 * Fires inside the adduser form tag.
     286 *
     287 * @since 3.0.0
     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" />
     
    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" />
     
    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 1.5.1
     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>
Note: See TracChangeset for help on using the changeset viewer.