WordPress.org

Make WordPress Core

Changeset 37547


Ignore:
Timestamp:
05/24/2016 04:15:57 AM (3 years ago)
Author:
jeremyfelt
Message:

Multisite: Clean up WP_Error documentation and handling in wp-signup.php

Fixes #36927.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-signup.php

    r37546 r37547  
    9292 * @since MU
    9393 *
    94  * @param string $blogname The new site name
    95  * @param string $blog_title The new site title
    96  * @param array $errors
     94 * @param string          $blogname   The new site name.
     95 * @param string          $blog_title The new site title.
     96 * @param WP_Error|string $errors     A WP_Error object containing existing errors. Defaults to empty string.
    9797 */
    9898function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
     99    if ( ! is_wp_error( $errors ) ) {
     100        $errors = new WP_Error();
     101    }
     102
    99103    $current_site = get_current_site();
    100104    // Blog name
     
    184188     * @since 3.0.0
    185189     *
    186      * @param array $errors An array possibly containing 'blogname' or 'blog_title' errors.
     190     * @param WP_Error $errors A WP_Error object possibly containing 'blogname' or 'blog_title' errors.
    187191     */
    188192    do_action( 'signup_blogform', $errors );
     
    209213 * @since MU
    210214 *
    211  * @param string $user_name The entered username
    212  * @param string $user_email The entered email address
    213  * @param array $errors
     215 * @param string          $user_name  The entered username.
     216 * @param string          $user_email The entered email address.
     217 * @param WP_Error|string $errors     A WP_Error object containing existing errors. Defaults to empty string.
    214218 */
    215219function show_user_form($user_name = '', $user_email = '', $errors = '') {
     220    if ( ! is_wp_error( $errors ) ) {
     221        $errors = new WP_Error();
     222    }
     223
    216224    // User name
    217225    echo '<label for="user_name">' . __('Username:') . '</label>';
     
    237245     * @since 3.0.0
    238246     *
    239      * @param array $errors An array possibly containing 'user_name' or 'user_email' errors.
     247     * @param WP_Error $errors A WP_Error object containing containing 'user_name' or 'user_email' errors.
    240248     */
    241249    do_action( 'signup_extra_fields', $errors );
     
    258266 * @since MU
    259267 *
    260  * @param string $blogname The new site name
    261  * @param string $blog_title The new site title.
    262  * @param array $errors
     268 * @param string          $blogname  The new site name
     269 * @param string          $blog_title The new site title.
     270 * @param WP_Error|string $errors     A WP_Error object containing existing errors. Defaults to empty string.
    263271 */
    264272function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) {
     
    283291     *     An array of default site sign-up variables.
    284292     *
    285      *     @type string $blogname   The site blogname.
    286      *     @type string $blog_title The site title.
    287      *     @type array  $errors     An array possibly containing 'blogname' or 'blog_title' errors.
     293     *     @type string   $blogname   The site blogname.
     294     *     @type string   $blog_title The site title.
     295     *     @type WP_Error $errors     A WP_Error object possibly containing 'blogname' or 'blog_title' errors.
    288296     * }
    289297     */
     
    478486 * @since MU
    479487 *
    480  * @param string $user_name The username
    481  * @param string $user_email The user's email
    482  * @param array $errors
     488 * @param string          $user_name  The username.
     489 * @param string          $user_email The user's email.
     490 * @param WP_Error|string $errors     A WP_Error object containing existing errors. Defaults to empty string.
    483491 */
    484492function signup_user( $user_name = '', $user_email = '', $errors = '' ) {
     
    504512     *     An array of default user variables.
    505513     *
    506      *     @type string $user_name  The user username.
    507      *     @type string $user_email The user email address.
    508      *     @type array  $errors     An array of possible errors relevant to the sign-up user.
     514     *     @type string   $user_name  The user username.
     515     *     @type string   $user_email The user email address.
     516     *     @type WP_Error $errors     A WP_Error object with possible errors relevant to the sign-up user.
    509517     * }
    510518     */
     
    600608 * @since MU
    601609 *
    602  * @param string $user_name The username
    603  * @param string $user_email The user's email address
    604  * @param string $blogname The site name
    605  * @param string $blog_title The site title
    606  * @param array $errors
     610 * @param string          $user_name  The username.
     611 * @param string          $user_email The user's email address.
     612 * @param string          $blogname   The site name.
     613 * @param string          $blog_title The site title.
     614 * @param WP_Error|string $errors     A WP_Error object containing existing errors. Defaults to empty string.
    607615 */
    608616function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') {
     
    626634     *     An array of default site creation variables.
    627635     *
    628      *     @type string $user_name  The user username.
    629      *     @type string $user_email The user email address.
    630      *     @type string $blogname   The blogname.
    631      *     @type string $blog_title The title of the site.
    632      *     @type array  $errors     An array of possible errors relevant to new site creation variables.
     636     *     @type string   $user_name  The user username.
     637     *     @type string   $user_email The user email address.
     638     *     @type string   $blogname   The blogname.
     639     *     @type string   $blog_title The title of the site.
     640     *     @type WP_Error $errors     A WP_Error object with possible errors relevant to new site creation variables.
    633641     * }
    634642     */
Note: See TracChangeset for help on using the changeset viewer.