<!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>[25645] trunk/src/wp-signup.php: Inline documentation for hooks in 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 { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { 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/25645">25645</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2013-09-28 23:41:07 +0000 (Sat, 28 Sep 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Inline documentation for hooks in wp-signup.php.
Props kpdesign, miyauchi.
Fixes <a href="http://core.trac.wordpress.org/ticket/25381">#25381</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpsignupphp">trunk/src/wp-signup.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpsignupphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-signup.php (25644 => 25645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-signup.php 2013-09-28 21:28:03 UTC (rev 25644)
+++ trunk/src/wp-signup.php 2013-09-28 23:41:07 UTC (rev 25645)
</span><span class="lines">@@ -18,6 +18,11 @@
</span><span class="cx"> * @since MU
</span><span class="cx"> */
</span><span class="cx"> function do_signup_header() {
</span><ins>+ /**
+ * Fires within the <head> section of the site sign-up screen.
+ *
+ * @since 3.0.0
+ */
</ins><span class="cx"> do_action( 'signup_header' );
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_head', 'do_signup_header' );
</span><span class="lines">@@ -63,6 +68,11 @@
</span><span class="cx"> add_action( 'wp_head', 'wpmu_signup_stylesheet' );
</span><span class="cx"> get_header();
</span><span class="cx">
</span><ins>+/**
+ * Fires before the site sign-up form.
+ *
+ * @since 3.0.0
+ */
</ins><span class="cx"> do_action( 'before_signup_form' );
</span><span class="cx"> ?>
</span><span class="cx"> <div id="content" class="widecolumn">
</span><span class="lines">@@ -128,7 +138,14 @@
</span><span class="cx"> </div>
</span><span class="cx">
</span><span class="cx"> <?php
</span><del>- do_action('signup_blogform', $errors);
</del><ins>+ /**
+ * Fires after the site sign-up form.
+ *
+ * @since 3.0.0
+ *
+ * @param array $errors An array possibly containing 'blogname' or 'blog_title' errors.
+ */
+ do_action( 'signup_blogform', $errors );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -176,6 +193,13 @@
</span><span class="cx"> if ( $errmsg = $errors->get_error_message('generic') ) {
</span><span class="cx"> echo '<p class="error">' . $errmsg . '</p>';
</span><span class="cx"> }
</span><ins>+ /**
+ * Fires at the end of the user registration form on the site sign-up form.
+ *
+ * @since 3.0.0
+ *
+ * @param array $errors An array possibly containing 'user_name' or 'user_email' errors.
+ */
</ins><span class="cx"> do_action( 'signup_extra_fields', $errors );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -209,8 +233,27 @@
</span><span class="cx"> $errors = new WP_Error();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // allow definition of default variables
- $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
</del><ins>+ $signup_defaults = array(
+ 'blogname' => $blogname,
+ 'blog_title' => $blog_title,
+ 'errors' => $errors
+ );
+
+ /**
+ * Filter the default site sign-up variables.
+ *
+ * @since 3.0.0
+ *
+ * @param array $signup_defaults {
+ * An array of default site sign-up variables.
+ *
+ * @type string $blogname The site blogname.
+ * @type string $blog_title The site title.
+ * @type array $errors An array possibly containing 'blogname' or 'blog_title' errors.
+ * }
+ */
+ $filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults );
+
</ins><span class="cx"> $blogname = $filtered_results['blogname'];
</span><span class="cx"> $blog_title = $filtered_results['blog_title'];
</span><span class="cx"> $errors = $filtered_results['errors'];
</span><span class="lines">@@ -241,11 +284,11 @@
</span><span class="cx"> <input type="hidden" name="stage" value="gimmeanotherblog" />
</span><span class="cx"> <?php
</span><span class="cx"> /**
</span><del>- * Hidden signup form fields output for creating another site.
</del><ins>+ * Hidden sign-up form fields output when creating another site or user.
</ins><span class="cx"> *
</span><span class="cx"> * @since MU
</span><span class="cx"> *
</span><del>- * @param string $context A string describing the step of the signup process. the value can be
</del><ins>+ * @param string $context A string describing the steps of the sign-up process. The value can be
</ins><span class="cx"> * 'create-another-site', 'validate-user', or 'validate-site'.
</span><span class="cx"> */
</span><span class="cx"> do_action( 'signup_hidden_fields', 'create-another-site' );
</span><span class="lines">@@ -281,7 +324,33 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> $public = (int) $_POST['blog_public'];
</span><del>- $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // deprecated
</del><ins>+
+ $blog_meta_defaults = array(
+ 'lang_id' => 1,
+ 'public' => $public
+ );
+
+ /**
+ * Filter the new site meta variables.
+ *
+ * @since MU
+ * @deprecated 3.0.0 Use the 'add_signup_meta' filter instead.
+ *
+ * @param array $blog_meta_defaults An array of default blog meta variables.
+ */
+ $meta = apply_filters( 'signup_create_blog_meta', $blog_meta_defaults );
+ /**
+ * Filter the new default site meta variables.
+ *
+ * @since 3.0.0
+ *
+ * @param array $meta {
+ * An array of default site meta variables.
+ *
+ * @type int $lang_id The language ID.
+ * @type int $blog_public Whether search engines should be discouraged from indexing the site. 1 for true, 0 for false.
+ * }
+ */
</ins><span class="cx"> $meta = apply_filters( 'add_signup_meta', $meta );
</span><span class="cx">
</span><span class="cx"> wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid );
</span><span class="lines">@@ -307,6 +376,11 @@
</span><span class="cx"> <?php printf( __( '<a href="http://%1$s">http://%2$s</a> is your new site. <a href="%3$s">Log in</a> as “%4$s” using your existing password.' ), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name ) ?>
</span><span class="cx"> </p>
</span><span class="cx"> <?php
</span><ins>+ /**
+ * Fires when the site or user sign-up process is complete.
+ *
+ * @since 3.0.0
+ */
</ins><span class="cx"> do_action( 'signup_finished' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -329,8 +403,26 @@
</span><span class="cx">
</span><span class="cx"> $signup_for = isset( $_POST[ 'signup_for' ] ) ? esc_html( $_POST[ 'signup_for' ] ) : 'blog';
</span><span class="cx">
</span><del>- // allow definition of default variables
- $filtered_results = apply_filters('signup_user_init', array('user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors ));
</del><ins>+ $signup_user_defaults = array(
+ 'user_name' => $user_name,
+ 'user_email' => $user_email,
+ 'errors' => $errors,
+ );
+
+ /**
+ * Filter the default user variables used on the user sign-up form.
+ *
+ * @since 3.0.0
+ *
+ * @param array $signup_user_defaults {
+ * An array of default user variables.
+ *
+ * @type string $user_name The user username.
+ * @type string $user_email The user email address.
+ * @type array $errors An array of possible errors relevant to the sign-up user.
+ * }
+ */
+ $filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults );
</ins><span class="cx"> $user_name = $filtered_results['user_name'];
</span><span class="cx"> $user_email = $filtered_results['user_email'];
</span><span class="cx"> $errors = $filtered_results['errors'];
</span><span class="lines">@@ -389,7 +481,8 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- wpmu_signup_user($user_name, $user_email, apply_filters( 'add_signup_meta', array() ) );
</del><ins>+ //duplicate_hook
+ wpmu_signup_user( $user_name, $user_email, apply_filters( 'add_signup_meta', array() ) );
</ins><span class="cx">
</span><span class="cx"> confirm_user_signup($user_name, $user_email);
</span><span class="cx"> return true;
</span><span class="lines">@@ -410,6 +503,7 @@
</span><span class="cx"> <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ), $user_email ); ?></p>
</span><span class="cx"> <p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p>
</span><span class="cx"> <?php
</span><ins>+ //duplicate_hook
</ins><span class="cx"> do_action( 'signup_finished' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -430,8 +524,31 @@
</span><span class="cx"> if ( !is_wp_error($errors) )
</span><span class="cx"> $errors = new WP_Error();
</span><span class="cx">
</span><del>- // allow definition of default variables
- $filtered_results = apply_filters('signup_blog_init', array('user_name' => $user_name, 'user_email' => $user_email, 'blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
</del><ins>+ $signup_blog_defaults = array(
+ 'user_name' => $user_name,
+ 'user_email' => $user_email,
+ 'blogname' => $blogname,
+ 'blog_title' => $blog_title,
+ 'errors' => $errors
+ );
+
+ /**
+ * Filter the default site creation variables for the site sign-up form.
+ *
+ * @since 3.0.0
+ *
+ * @param array $signup_blog_defaults {
+ * An array of default site creation variables.
+ *
+ * @type string $user_name The user username.
+ * @type string $user_email The user email address.
+ * @type string $blogname The blogname.
+ * @type string $blog_title The title of the site.
+ * @type array $errors An array of possible errors relevant to new site creation variables.
+ * }
+ */
+ $filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults );
+
</ins><span class="cx"> $user_name = $filtered_results['user_name'];
</span><span class="cx"> $user_email = $filtered_results['user_email'];
</span><span class="cx"> $blogname = $filtered_results['blogname'];
</span><span class="lines">@@ -487,6 +604,8 @@
</span><span class="cx">
</span><span class="cx"> $public = (int) $_POST['blog_public'];
</span><span class="cx"> $meta = array ('lang_id' => 1, 'public' => $public);
</span><ins>+
+ //duplicate_hook
</ins><span class="cx"> $meta = apply_filters( 'add_signup_meta', $meta );
</span><span class="cx">
</span><span class="cx"> wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta);
</span><span class="lines">@@ -523,12 +642,21 @@
</span><span class="cx"> </ul>
</span><span class="cx"> </p>
</span><span class="cx"> <?php
</span><ins>+ //duplicate_hook
</ins><span class="cx"> do_action( 'signup_finished' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Main
</span><span class="cx"> $active_signup = get_site_option( 'registration', 'none' );
</span><del>-$active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user"
</del><ins>+/**
+ * Filter the type of site sign-up.
+ *
+ * @since 3.0.0
+ *
+ * @param string $active_signup String that returns registration type. The value can be
+ * 'all', 'none', 'blog', or 'user'.
+ */
+$active_signup = apply_filters( 'wpmu_active_signup', $active_signup );
</ins><span class="cx">
</span><span class="cx"> // Make the signup type translatable.
</span><span class="cx"> $i18n_signup['all'] = _x('all', 'Multisite active signup type');
</span><span class="lines">@@ -568,7 +696,12 @@
</span><span class="cx"> case 'default':
</span><span class="cx"> default :
</span><span class="cx"> $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : '';
</span><del>- do_action( 'preprocess_signup_form' ); // populate the form from invites, elsewhere?
</del><ins>+ /**
+ * Fires when the site sign-up form is sent.
+ *
+ * @since 3.0.0
+ */
+ do_action( 'preprocess_signup_form' );
</ins><span class="cx"> if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) )
</span><span class="cx"> signup_another_blog($newblogname);
</span><span class="cx"> elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) )
</span><span class="lines">@@ -592,6 +725,12 @@
</span><span class="cx"> ?>
</span><span class="cx"> </div>
</span><span class="cx"> </div>
</span><del>-<?php do_action( 'after_signup_form' ); ?>
</del><ins>+<?php
+/**
+ * Fires after the sign-up forms, before wp_footer.
+ *
+ * @since 3.0.0
+ */
+do_action( 'after_signup_form' ); ?>
</ins><span class="cx">
</span><span class="cx"> <?php get_footer(); ?>
</span></span></pre>
</div>
</div>
</body>
</html>