Make WordPress Core

Ticket #22187: 22187-docblocks.2.diff

File 22187-docblocks.2.diff, 6.9 KB (added by DrewAPicture, 12 years ago)
  • wp-signup.php

     
    1212        die();
    1313}
    1414
     15/**
     16 * Prints signup_header via wp_head
     17 *
     18 * @since 3.0.0
     19 */
    1520function do_signup_header() {
    1621        do_action( 'signup_header' );
    1722}
     
    3035// Fix for page title
    3136$wp_query->is_404 = false;
    3237
     38/**
     39 * Prints styles for front-end Multisite signup pages
     40 *
     41 * @since 3.0.0
     42 */
    3343function wpmu_signup_stylesheet() {
    3444        ?>
    3545        <style type="text/css">
     
    5868<div id="content" class="widecolumn">
    5969<div class="mu_register">
    6070<?php
     71/**
     72 * Generates and displays the Signup and Create Site forms
     73 *
     74 * @since 3.0.0
     75 *
     76 * @param string $blogname The new site name
     77 * @param string $blog_title The new site title
     78 * @param array $errors
     79 */
    6180function show_blog_form($blogname = '', $blog_title = '', $errors = '') {
    6281        global $current_site;
    6382        // Blog name
     
    112131        do_action('signup_blogform', $errors);
    113132}
    114133
     134/**
     135 * Validate the new site signup
     136 *
     137 * @since 3.0.0
     138 *
     139 * @uses wp_get_current_user() to retrieve the current user
     140 * @uses wpmu_validate_blog_signup() to validate new site signup for the current user
     141 * @return array Contains the new site data and error messages.
     142 */
    115143function validate_blog_form() {
    116144        $user = '';
    117145        if ( is_user_logged_in() )
     
    120148        return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user);
    121149}
    122150
     151/**
     152 * Display user registration form
     153 *
     154 * @since 3.0.0
     155 *
     156 * @param string $user_name The entered username
     157 * @param string $user_email The entered email address
     158 * @param array $errors
     159 */
    123160function show_user_form($user_name = '', $user_email = '', $errors = '') {
    124161        // User name
    125162        echo '<label for="user_name">' . __('Username:') . '</label>';
     
    142179        do_action( 'signup_extra_fields', $errors );
    143180}
    144181
     182/**
     183 * Validate user signup name and email
     184 *
     185 * @since 3.0.0
     186 *
     187 * @uses wpmu_validate_user_signup() to retrieve an array of user data
     188 * @return array Contains username, email, and error messages.
     189 */
    145190function validate_user_form() {
    146191        return wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
    147192}
    148193
     194/**
     195 * Allow returning users to sign up for another site
     196 *
     197 * @since 3.0.0
     198 *
     199 * @uses wp_get_current_user() to get the current user
     200 * @param string $blogname The new site name
     201 * @param string $blog_title The new blog title
     202 * @param array $errors
     203 */
    149204function signup_another_blog($blogname = '', $blog_title = '', $errors = '') {
    150205        global $current_site;
    151206        $current_user = wp_get_current_user();
     
    191246        <?php
    192247}
    193248
     249/**
     250 * Validate a new blog signup
     251 *
     252 * @since 3.0.0
     253 *
     254 * @uses wp_get_current_user() to retrieve the current user
     255 * @uses wpmu_create_blog() to add a new site
     256 * @uses confirm_another_blog_signup() to confirm the user's new site signup
     257 * @return bool True if blog signup was validated, False if error
     258 */
    194259function validate_another_blog_signup() {
    195260        global $wpdb, $blogname, $blog_title, $errors, $domain, $path;
    196261        $current_user = wp_get_current_user();
     
    214279        return true;
    215280}
    216281
     282/**
     283 * Confirm a new site signup
     284 *
     285 * @since 3.0.0
     286 *
     287 * @param string $domain The domain URL
     288 * @param string $path The site root path
     289 * @param string $user_name The username
     290 * @param string $user_email The user's email address
     291 * @param string $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
     292 */
    217293function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email = '', $meta = '') {
    218294        ?>
    219295        <h2><?php printf( __( 'The site %s is yours.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>
     
    224300        do_action( 'signup_finished' );
    225301}
    226302
     303/**
     304 * Setup the new user signup process
     305 *
     306 * @since 3.0.0
     307 *
     308 * @uses apply_filters() filter $filtered_results
     309 * @uses show_user_form() to display the user registration form
     310 * @param string $user_name The username
     311 * @param string $user_email The user's email
     312 * @param array $errors
     313 */
    227314function signup_user($user_name = '', $user_email = '', $errors = '') {
    228315        global $current_site, $active_signup;
    229316
     
    265352        <?php
    266353}
    267354
     355/**
     356 * Validate the new user signup
     357 *
     358 * @since 3.0.0
     359 *
     360 * @uses validate_user_form() to retrieve an array of the user data
     361 * @uses wpmu_signup_user() to signup the new user
     362 * @uses confirm_user_signup() to confirm the new user signup
     363 * @return bool True if new user signup was validated, False if error
     364 */
    268365function validate_user_signup() {
    269366        $result = validate_user_form();
    270367        extract($result);
     
    285382        return true;
    286383}
    287384
     385/**
     386 * New user signup confirmation
     387 *
     388 * @since 3.0.0
     389 *
     390 * @param string $user_name The username
     391 * @param string $user_email The user's email address
     392 */
    288393function confirm_user_signup($user_name, $user_email) {
    289394        ?>
    290395        <h2><?php printf( __( '%s is your new username' ), $user_name) ?></h2>
     
    295400        do_action( 'signup_finished' );
    296401}
    297402
     403/**
     404 * Setup the new site signup
     405 *
     406 * @since 3.0.0
     407 *
     408 * @uses apply_filters() to filter $filtered_results
     409 * @uses show_blog_form() to display the blog signup form
     410 * @param string $user_name The username
     411 * @param string $user_email The user's email address
     412 * @param string $blogname The site name
     413 * @param string $blog_title The site title
     414 * @param array $errors
     415 */
    298416function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') {
    299417        if ( !is_wp_error($errors) )
    300418                $errors = new WP_Error();
     
    321439        <?php
    322440}
    323441
     442/**
     443 * Validate new site signup
     444 *
     445 * @since 3.0.0
     446 *
     447 * @uses wpmu_validate_user_signup() to retrieve an array of the new user data and errors
     448 * @uses wpmu_validate_blog_signup() to retrieve an array of the new site data and errors
     449 * @uses apply_filters() to make signup $meta filterable
     450 * @uses signup_user() to signup a new user
     451 * @uses signup_blog() to signup a the new user to a new site
     452 * @return bool True of the site signup was validated, False if error
     453 */
    324454function validate_blog_signup() {
    325455        // Re-validate user info.
    326456        $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
     
    348478        return true;
    349479}
    350480
     481/**
     482 * New site signup confirmation
     483 *
     484 * @since 3.0.0
     485 *
     486 * @param string $domain The domain URL
     487 * @param string $path The site root path
     488 * @param string $blog_title The new site title
     489 * @param string $user_name The user's username
     490 * @param string $user_email The user's email address
     491 * @param string $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
     492 */
    351493function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user_email = '', $meta) {
    352494        ?>
    353495        <h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>