<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[23362] trunk/wp-signup.php: Add inline documentation for wp-signup.php.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23362">23362</a></dd>
<dt>Author</dt> <dd>SergeyBiryukov</dd>
<dt>Date</dt> <dd>2013-01-31 03:13:22 +0000 (Thu, 31 Jan 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add inline documentation for wp-signup.php. props DrewAPicture. fixes <a href="http://core.trac.wordpress.org/ticket/22187">#22187</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpsignupphp">trunk/wp-signup.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpsignupphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-signup.php (23361 => 23362)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-signup.php        2013-01-31 01:55:09 UTC (rev 23361)
+++ trunk/wp-signup.php        2013-01-31 03:13:22 UTC (rev 23362)
</span><span class="lines">@@ -12,6 +12,11 @@
</span><span class="cx">         die();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Prints signup_header via wp_head
+ *
+ * @since MU
+ */
</ins><span class="cx"> function do_signup_header() {
</span><span class="cx">         do_action( 'signup_header' );
</span><span class="cx"> }
</span><span class="lines">@@ -30,6 +35,11 @@
</span><span class="cx"> // Fix for page title
</span><span class="cx"> $wp_query->is_404 = false;
</span><span class="cx">
</span><ins>+/**
+ * Prints styles for front-end Multisite signup pages
+ *
+ * @since MU
+ */
</ins><span class="cx"> function wpmu_signup_stylesheet() {
</span><span class="cx">         ?>
</span><span class="cx">         <style type="text/css">
</span><span class="lines">@@ -58,6 +68,15 @@
</span><span class="cx"> <div id="content" class="widecolumn">
</span><span class="cx"> <div class="mu_register">
</span><span class="cx"> <?php
</span><ins>+/**
+ * Generates and displays the Signup and Create Site forms
+ *
+ * @since MU
+ *
+ * @param string $blogname The new site name
+ * @param string $blog_title The new site title
+ * @param array $errors
+ */
</ins><span class="cx"> function show_blog_form($blogname = '', $blog_title = '', $errors = '') {
</span><span class="cx">         global $current_site;
</span><span class="cx">         // Blog name
</span><span class="lines">@@ -112,6 +131,15 @@
</span><span class="cx">         do_action('signup_blogform', $errors);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Validate the new site signup
+ *
+ * @since MU
+ *
+ * @uses wp_get_current_user() to retrieve the current user
+ * @uses wpmu_validate_blog_signup() to validate new site signup for the current user
+ * @return array Contains the new site data and error messages.
+ */
</ins><span class="cx"> function validate_blog_form() {
</span><span class="cx">         $user = '';
</span><span class="cx">         if ( is_user_logged_in() )
</span><span class="lines">@@ -120,6 +148,15 @@
</span><span class="cx">         return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Display user registration form
+ *
+ * @since MU
+ *
+ * @param string $user_name The entered username
+ * @param string $user_email The entered email address
+ * @param array $errors
+ */
</ins><span class="cx"> function show_user_form($user_name = '', $user_email = '', $errors = '') {
</span><span class="cx">         // User name
</span><span class="cx">         echo '<label for="user_name">' . __('Username:') . '</label>';
</span><span class="lines">@@ -142,10 +179,28 @@
</span><span class="cx">         do_action( 'signup_extra_fields', $errors );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Validate user signup name and email
+ *
+ * @since MU
+ *
+ * @uses wpmu_validate_user_signup() to retrieve an array of user data
+ * @return array Contains username, email, and error messages.
+ */
</ins><span class="cx"> function validate_user_form() {
</span><span class="cx">         return wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Allow returning users to sign up for another site
+ *
+ * @since MU
+ *
+ * @uses wp_get_current_user() to get the current user
+ * @param string $blogname The new site name
+ * @param string $blog_title The new blog title
+ * @param array $errors
+ */
</ins><span class="cx"> function signup_another_blog($blogname = '', $blog_title = '', $errors = '') {
</span><span class="cx">         global $current_site;
</span><span class="cx">         $current_user = wp_get_current_user();
</span><span class="lines">@@ -191,6 +246,16 @@
</span><span class="cx">         <?php
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Validate a new blog signup
+ *
+ * @since MU
+ *
+ * @uses wp_get_current_user() to retrieve the current user
+ * @uses wpmu_create_blog() to add a new site
+ * @uses confirm_another_blog_signup() to confirm the user's new site signup
+ * @return bool True if blog signup was validated, false if error
+ */
</ins><span class="cx"> function validate_another_blog_signup() {
</span><span class="cx">         global $wpdb, $blogname, $blog_title, $errors, $domain, $path;
</span><span class="cx">         $current_user = wp_get_current_user();
</span><span class="lines">@@ -214,6 +279,17 @@
</span><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Confirm a new site signup
+ *
+ * @since MU
+ *
+ * @param string $domain The domain URL
+ * @param string $path The site root path
+ * @param string $user_name The username
+ * @param string $user_email The user's email address
+ * @param string $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
+ */
</ins><span class="cx"> function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email = '', $meta = '') {
</span><span class="cx">         ?>
</span><span class="cx">         <h2><?php printf( __( 'The site %s is yours.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>
</span><span class="lines">@@ -224,6 +300,17 @@
</span><span class="cx">         do_action( 'signup_finished' );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Setup the new user signup process
+ *
+ * @since MU
+ *
+ * @uses apply_filters() filter $filtered_results
+ * @uses show_user_form() to display the user registration form
+ * @param string $user_name The username
+ * @param string $user_email The user's email
+ * @param array $errors
+ */
</ins><span class="cx"> function signup_user($user_name = '', $user_email = '', $errors = '') {
</span><span class="cx">         global $current_site, $active_signup;
</span><span class="cx">
</span><span class="lines">@@ -265,6 +352,16 @@
</span><span class="cx">         <?php
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Validate the new user signup
+ *
+ * @since MU
+ *
+ * @uses validate_user_form() to retrieve an array of the user data
+ * @uses wpmu_signup_user() to signup the new user
+ * @uses confirm_user_signup() to confirm the new user signup
+ * @return bool True if new user signup was validated, false if error
+ */
</ins><span class="cx"> function validate_user_signup() {
</span><span class="cx">         $result = validate_user_form();
</span><span class="cx">         extract($result);
</span><span class="lines">@@ -285,6 +382,14 @@
</span><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * New user signup confirmation
+ *
+ * @since MU
+ *
+ * @param string $user_name The username
+ * @param string $user_email The user's email address
+ */
</ins><span class="cx"> function confirm_user_signup($user_name, $user_email) {
</span><span class="cx">         ?>
</span><span class="cx">         <h2><?php printf( __( '%s is your new username' ), $user_name) ?></h2>
</span><span class="lines">@@ -295,6 +400,19 @@
</span><span class="cx">         do_action( 'signup_finished' );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Setup the new site signup
+ *
+ * @since MU
+ *
+ * @uses apply_filters() to filter $filtered_results
+ * @uses show_blog_form() to display the blog signup form
+ * @param string $user_name The username
+ * @param string $user_email The user's email address
+ * @param string $blogname The site name
+ * @param string $blog_title The site title
+ * @param array $errors
+ */
</ins><span class="cx"> function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') {
</span><span class="cx">         if ( !is_wp_error($errors) )
</span><span class="cx">                 $errors = new WP_Error();
</span><span class="lines">@@ -321,6 +439,18 @@
</span><span class="cx">         <?php
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Validate new site signup
+ *
+ * @since MU
+ *
+ * @uses wpmu_validate_user_signup() to retrieve an array of the new user data and errors
+ * @uses wpmu_validate_blog_signup() to retrieve an array of the new site data and errors
+ * @uses apply_filters() to make signup $meta filterable
+ * @uses signup_user() to signup a new user
+ * @uses signup_blog() to signup a the new user to a new site
+ * @return bool True if the site signup was validated, false if error
+ */
</ins><span class="cx"> function validate_blog_signup() {
</span><span class="cx">         // Re-validate user info.
</span><span class="cx">         $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
</span><span class="lines">@@ -348,6 +478,18 @@
</span><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * New site signup confirmation
+ *
+ * @since MU
+ *
+ * @param string $domain The domain URL
+ * @param string $path The site root path
+ * @param string $blog_title The new site title
+ * @param string $user_name The user's username
+ * @param string $user_email The user's email address
+ * @param string $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
+ */
</ins><span class="cx"> function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user_email = '', $meta) {
</span><span class="cx">         ?>
</span><span class="cx">         <h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>
</span></span></pre>
</div>
</div>
</body>
</html>