Make WordPress Core

Ticket #25381: 25381.diff

File 25381.diff, 5.5 KB (added by DrewAPicture, 11 years ago)

Hook docs fixes

  • src/wp-signup.php

     
    232232                $errors = new WP_Error();
    233233        }
    234234
    235         $signup_defaults = array(
    236                 'blogname'   => $blogname,
    237                 'blog_title' => $blog_title,
    238                 'errors'     => $errors
    239         );
    240 
    241235        /**
    242236         * Filter the default site sign-up variables.
    243237         *
     
    251245         *     @type array  $errors     An array possibly containing 'blogname' or 'blog_title' errors.
    252246         * }
    253247         */
    254         $filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults );
     248        $filtered_results = apply_filters( 'signup_another_blog_init', array(
     249                'blogname'   => $blogname,
     250                'blog_title' => $blog_title,
     251                'errors'     => $errors
     252        ) );
    255253
    256254        $blogname = $filtered_results['blogname'];
    257255        $blog_title = $filtered_results['blog_title'];
     
    324322
    325323        $public = (int) $_POST['blog_public'];
    326324
    327         $blog_meta_defaults = array(
    328                 'lang_id' => 1,
    329                 'public'  => $public
    330         );
    331 
    332325        /**
    333326         * Filter the new site meta variables.
    334327         *
    335328         * @since MU
    336329         * @deprecated 3.0.0 Use the 'add_signup_meta' filter instead.
    337330         *
    338          * @param array $blog_meta_defaults An array of default blog meta variables.
     331         * @param array $blog_meta_defaults {
     332         *     An array of default site meta variables.
     333         *
     334         *     @type int      $lang_id The language ID.
     335         *     @type int|bool $public  Whether search engines should be discouraged from indexing
     336         *                             the site. 1 for true, 0 for false.
     337         * }
    339338         */
    340         $meta = apply_filters( 'signup_create_blog_meta', $blog_meta_defaults );
     339        $meta = apply_filters( 'signup_create_blog_meta', array(
     340                'lang_id' => 1,
     341                'public'  => $public
     342        ) );
     343
    341344        /**
    342345         * Filter the new default site meta variables.
    343346         *
     
    346349         * @param array $meta {
    347350         *     An array of default site meta variables.
    348351         *
    349          *     @type int $lang_id     The language ID.
    350          *     @type int $blog_public Whether search engines should be discouraged from indexing the site. 1 for true, 0 for false.
     352         *     @type int      $lang_id     The language ID.
     353         *     @type int|bool $blog_public Whether search engines should be discouraged from indexing
     354         *                                 the site. 1 for true, 0 for false. Default 1|true.
    351355         * }
    352356         */
    353357        $meta = apply_filters( 'add_signup_meta', $meta );
     
    388392 *
    389393 * @since MU
    390394 *
    391  * @uses apply_filters() filter $filtered_results
    392395 * @uses show_user_form() to display the user registration form
    393396 * @param string $user_name The username
    394397 * @param string $user_email The user's email
     
    402405
    403406        $signup_for = isset( $_POST[ 'signup_for' ] ) ? esc_html( $_POST[ 'signup_for' ] ) : 'blog';
    404407
    405         $signup_user_defaults = array(
    406                 'user_name'  => $user_name,
    407                 'user_email' => $user_email,
    408                 'errors'     => $errors,
    409         );
    410 
    411408        /**
    412409         * Filter the default user variables used on the user sign-up form.
    413410         *
     
    421418         *     @type array  $errors     An array of possible errors relevant to the sign-up user.
    422419         * }
    423420         */
    424         $filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults );
     421        $filtered_results = apply_filters( 'signup_user_init', array(
     422                'user_name'  => $user_name,
     423                'user_email' => $user_email,
     424                'errors'     => $errors,
     425        ) );
     426
    425427        $user_name = $filtered_results['user_name'];
    426428        $user_email = $filtered_results['user_email'];
    427429        $errors = $filtered_results['errors'];
     
    511513 *
    512514 * @since MU
    513515 *
    514  * @uses apply_filters() to filter $filtered_results
    515516 * @uses show_blog_form() to display the blog signup form
    516517 * @param string $user_name The username
    517518 * @param string $user_email The user's email address
     
    523524        if ( !is_wp_error($errors) )
    524525                $errors = new WP_Error();
    525526
    526         $signup_blog_defaults = array(
    527                 'user_name'  => $user_name,
    528                 'user_email' => $user_email,
    529                 'blogname'   => $blogname,
    530                 'blog_title' => $blog_title,
    531                 'errors'     => $errors
    532         );
    533 
    534527        /**
    535528         * Filter the default site creation variables for the site sign-up form.
    536529         *
     
    539532         * @param array $signup_blog_defaults {
    540533         *     An array of default site creation variables.
    541534         *
    542          *     @type string $user_name  The user username.
    543          *     @type string $user_email The user email address.
     535         *     @type string $user_name  Username.
     536         *     @type string $user_email User email address.
    544537         *     @type string $blogname   The blogname.
    545538         *     @type string $blog_title The title of the site.
    546          *     @type array  $errors     An array of possible errors relevant to new site creation variables.
     539         *     @type array  $errors     An array of possible errors relevant to new site
     540         *                              creation variables.
    547541         * }
    548542         */
    549         $filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults );
     543        $filtered_results = apply_filters( 'signup_blog_init', array(
     544                'user_name'  => $user_name,
     545                'user_email' => $user_email,
     546                'blogname'   => $blogname,
     547                'blog_title' => $blog_title,
     548                'errors'     => $errors
     549        ) );
    550550
    551551        $user_name = $filtered_results['user_name'];
    552552        $user_email = $filtered_results['user_email'];
     
    578578 *
    579579 * @uses wpmu_validate_user_signup() to retrieve an array of the new user data and errors
    580580 * @uses wpmu_validate_blog_signup() to retrieve an array of the new site data and errors
    581  * @uses apply_filters() to make signup $meta filterable
    582581 * @uses signup_user() to signup a new user
    583582 * @uses signup_blog() to signup a the new user to a new site
    584583 * @return bool True if the site signup was validated, false if error