Make WordPress Core

Ticket #36927: 36927.diff

File 36927.diff, 5.8 KB (added by jeremyfelt, 9 years ago)
  • src/wp-signup.php

     
    9191 *
    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
    101105        if ( !is_subdomain_install() )
     
    183187         *
    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 );
    189193}
     
    208212 *
    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>';
    218226        if ( $errmsg = $errors->get_error_message('user_name') ) {
     
    236244         *
    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 );
    242250}
     
    257265 *
    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 = '' ) {
    265273        $current_user = wp_get_current_user();
     
    282290         * @param array $signup_defaults {
    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         */
    290298        $filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults );
     
    477485 *
    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 = '' ) {
    485493        global $active_signup;
     
    503511         * @param array $signup_user_defaults {
    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         */
    511519        $filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults );
     
    599607 *
    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 = '') {
    609617        if ( !is_wp_error($errors) )
     
    625633         * @param array $signup_blog_defaults {
    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         */
    635643        $filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults );