WordPress.org

Make WordPress Core

Ticket #22187: 22187.3.diff

File 22187.3.diff, 25.4 KB (added by DrewAPicture, 18 months ago)

22187.2.diff + general cleanup of the entire file

  • 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 * The default styles are printed via signup_header which is hooked to wp_head.  
     42 * They can be overloaded by replacing the output on the signup_header action hook. 
     43 * 
     44 * @since 3.0.0 
     45 */ 
    3346function wpmu_signup_stylesheet() { 
    3447        ?> 
    3548        <style type="text/css"> 
     
    5063        <?php 
    5164} 
    5265 
    53 add_action( 'wp_head', 'wpmu_signup_stylesheet' ); 
    5466get_header(); 
    5567 
    5668do_action( 'before_signup_form' ); 
     
    5870<div id="content" class="widecolumn"> 
    5971<div class="mu_register"> 
    6072<?php 
    61 function show_blog_form($blogname = '', $blog_title = '', $errors = '') { 
     73/** 
     74 * Generates and displays the Signup and Create Site forms 
     75 * 
     76 * @since 3.0.0 
     77 * 
     78 * @param string $blogname 
     79 * @param string $blog_title 
     80 * @param array $errors 
     81 */ 
     82function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) { 
    6283        global $current_site; 
    6384        // Blog name 
    64         if ( !is_subdomain_install() ) 
    65                 echo '<label for="blogname">' . __('Site Name:') . '</label>'; 
     85        if ( ! is_subdomain_install() ) 
     86                printf( '<label for="blogname">%s</label>', __('Site Name:') ); 
    6687        else 
    67                 echo '<label for="blogname">' . __('Site Domain:') . '</label>'; 
     88                printf( '<label for="blogname">%s</label>', __('Site Domain:') ); 
    6889 
    69         if ( $errmsg = $errors->get_error_message('blogname') ) { ?> 
     90        if ( $errmsg = $errors->get_error_message( 'blogname' ) ) { ?> 
    7091                <p class="error"><?php echo $errmsg ?></p> 
    7192        <?php } 
    7293 
    73         if ( !is_subdomain_install() ) 
    74                 echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'. esc_attr($blogname) .'" maxlength="60" /><br />'; 
    75         else 
    76                 echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="60" /><span class="suffix_address">.' . ( $site_domain = preg_replace( '|^www\.|', '', $current_site->domain ) ) . '</span><br />'; 
    77  
    78         if ( !is_user_logged_in() ) { 
    79                 if ( !is_subdomain_install() ) 
     94        if ( ! is_subdomain_install() ) { 
     95                printf( '<span class="prefix_address">%1$s</span><input name="blogname" type="text" id="blogname" value="%2$s" maxlength="60" /><br />', 
     96                        $current_site->domain . $current_site->path, 
     97                        esc_attr( $blogname ) 
     98                ); 
     99        } else { 
     100                printf( '<input name="blogname" type="text" id="blogname" value="%1$s" maxlength="60" /><span class="suffix_address">( %2$s )</span><br />',  
     101                        esc_attr( $blogname ), 
     102                        $site_domain = preg_replace( '|^www\.|', '', $current_site->domain )                     
     103                ); 
     104        } 
     105         
     106        if ( ! is_user_logged_in() ) { 
     107                if ( ! is_subdomain_install() ) { 
    80108                        $site = $current_site->domain . $current_site->path . __( 'sitename' ); 
    81                 else 
     109                } else { 
    82110                        $site = __( 'domain' ) . '.' . $site_domain . $current_site->path; 
    83                 echo '<p>(<strong>' . sprintf( __('Your address will be %s.'), $site ) . '</strong>) ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '</p>'; 
     111                        $address = sprintf( __('Your address will be %s.'), $site ) 
     112 
     113                        printf( '<p>(<strong>%1$s</strong>)%2$s</p>', 
     114                                $address, 
     115                                __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) 
     116                        ); 
     117                } 
    84118        } 
    85119 
    86120        // Blog Title 
    87121        ?> 
    88122        <label for="blog_title"><?php _e('Site Title:') ?></label> 
     123 
    89124        <?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?> 
    90125                <p class="error"><?php echo $errmsg ?></p> 
    91126        <?php } 
    92         echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_attr($blog_title).'" />'; 
     127 
     128        printf( '<input name="blog_title" type="text" id="blog_title" value="%s" />', esc_attr( $blog_title ) ); 
    93129        ?> 
    94130 
    95131        <div id="privacy"> 
    96132        <p class="privacy-intro"> 
    97             <label for="blog_public_on"><?php _e('Privacy:') ?></label> 
     133            <label for="blog_public_on"><?php _e( 'Privacy:' ) ?></label> 
    98134            <?php _e( 'Allow search engines to index this site.' ); ?> 
    99135            <br style="clear:both" /> 
    100136            <label class="checkbox" for="blog_public_on"> 
     
    109145        </div> 
    110146 
    111147        <?php 
    112         do_action('signup_blogform', $errors); 
     148        do_action( 'signup_blogform', $errors ); 
    113149} 
    114150 
     151/** 
     152 * {@internal Missing Short Description}} 
     153 * 
     154 * @since 3.0.0 
     155 * 
     156 * @uses wp_get_current_user() 
     157 * @return array 
     158 */ 
    115159function validate_blog_form() { 
    116160        $user = ''; 
    117161        if ( is_user_logged_in() ) 
     
    120164        return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user); 
    121165} 
    122166 
    123 function show_user_form($user_name = '', $user_email = '', $errors = '') { 
     167/** 
     168 * {@internal Missing Short Description}} 
     169 * 
     170 * @since 3.0.0 
     171 * 
     172 * @param string $user_name 
     173 * @param string $user_email 
     174 * @param array $errors 
     175 */ 
     176function show_user_form( $user_name = '', $user_email = '', $errors = '' ) { 
    124177        // User name 
    125         echo '<label for="user_name">' . __('Username:') . '</label>'; 
    126         if ( $errmsg = $errors->get_error_message('user_name') ) { 
    127                 echo '<p class="error">'.$errmsg.'</p>'; 
    128         } 
    129         echo '<input name="user_name" type="text" id="user_name" value="'. esc_attr($user_name) .'" maxlength="60" /><br />'; 
    130         _e( '(Must be at least 4 characters, letters and numbers only.)' ); 
    131         ?> 
     178        printf( '<label for="user_name">%s</label>', __( 'Username:' ) ); 
    132179 
     180        if ( $errmsg = $errors->get_error_message( 'user_name' ) ) { ?> 
     181                <p class="error"><?php echo $errmsg; ?></p> 
     182        <?php } ?> 
     183 
     184        <input name="user_name" type="text" id="user_name" value="<?php echo $esc_attr( $user_name ); ?>" maxlength="60" /><br /> 
     185        <?php _e( '(Must be at least 4 characters, letters and numbers only.)' ); ?> 
     186 
    133187        <label for="user_email"><?php _e( 'Email&nbsp;Address:' ) ?></label> 
     188 
    134189        <?php if ( $errmsg = $errors->get_error_message('user_email') ) { ?> 
    135190                <p class="error"><?php echo $errmsg ?></p> 
    136191        <?php } ?> 
    137         <input name="user_email" type="text" id="user_email" value="<?php  echo esc_attr($user_email) ?>" maxlength="200" /><br /><?php _e('We send your registration email to this address. (Double-check your email address before continuing.)') ?> 
     192 
     193        <input name="user_email" type="text" id="user_email" value="<?php echo esc_attr( $user_email ) ?>" maxlength="200" /><br /> 
     194        <?php _e( 'We send your registration email to this address. (Double-check your email address before continuing.)' ); ?> 
    138195        <?php 
    139         if ( $errmsg = $errors->get_error_message('generic') ) { 
    140                 echo '<p class="error">' . $errmsg . '</p>'; 
    141         } 
     196        if ( $errmsg = $errors->get_error_message('generic') ) { ?> 
     197                <p class="error"><?php echo $errmsg; ?></p> 
     198        <?php } 
     199 
    142200        do_action( 'signup_extra_fields', $errors ); 
    143201} 
    144202 
     203/** 
     204 * {@internal Missing Short Description}} 
     205 * 
     206 * @since 3.0.0 
     207 * 
     208 * @return array 
     209 */ 
    145210function validate_user_form() { 
    146211        return wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']); 
    147212} 
    148213 
    149 function signup_another_blog($blogname = '', $blog_title = '', $errors = '') { 
     214/** 
     215 * {@internal Missing Short Description}} 
     216 * 
     217 * @since 3.0.0 
     218 * 
     219 * @uses wp_get_current_user() 
     220 * @param string $blogname 
     221 * @param string $blog_title 
     222 * @param array $errors 
     223 */ 
     224function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) { 
    150225        global $current_site; 
    151226        $current_user = wp_get_current_user(); 
    152227 
     
    155230        } 
    156231 
    157232        // allow definition of default variables 
    158         $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); 
     233        $filtered_results = apply_filters( 'signup_another_blog_init', array( 'blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ) ); 
    159234        $blogname = $filtered_results['blogname']; 
    160235        $blog_title = $filtered_results['blog_title']; 
    161236        $errors = $filtered_results['errors']; 
    162237 
    163         echo '<h2>' . sprintf( __( 'Get <em>another</em> %s site in seconds' ), $current_site->site_name ) . '</h2>'; 
     238        printf( '<h2>%s</h2>', sprintf( __( 'Get <em>another</em> %s site in seconds' ), $current_site->site_name ) ); 
    164239 
    165         if ( $errors->get_error_code() ) { 
    166                 echo '<p>' . __( 'There was a problem, please correct the form below and try again.' ) . '</p>'; 
    167         } 
     240        if ( $errors->get_error_code() ) 
     241                printf( '<p>%s</p>', __( 'There was a problem, please correct the form below and try again.' ) ); 
    168242        ?> 
    169         <p><?php printf( __( 'Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart&#8217;s content, but write responsibly!' ), $current_user->display_name ) ?></p> 
     243        <p> 
     244                <?php printf( __( 'Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart&#8217;s content, but write responsibly!' ), $current_user->display_name ); ?> 
     245        </p> 
    170246 
    171247        <?php 
    172         $blogs = get_blogs_of_user($current_user->ID); 
    173         if ( !empty($blogs) ) { ?> 
     248        $blogs = get_blogs_of_user( $current_user->ID ); 
     249        if ( ! empty( $blogs ) ) { ?> 
    174250 
    175                         <p><?php _e( 'Sites you are already a member of:' ) ?></p> 
     251                        <p><?php _e( 'Sites you are already a member of:' ); ?></p> 
    176252                        <ul> 
    177253                                <?php foreach ( $blogs as $blog ) { 
    178254                                        $home_url = get_home_url( $blog->userblog_id ); 
    179                                         echo '<li><a href="' . esc_url( $home_url ) . '">' . $home_url . '</a></li>'; 
     255                                        printf( '<li><a href="%1$s">%2$s</a></li>', esc_url( $home_url ), $home_url ); 
    180256                                } ?> 
    181257                        </ul> 
    182258        <?php } ?> 
    183259 
    184         <p><?php _e( 'If you&#8217;re not going to use a great site domain, leave it for a new user. Now have at it!' ) ?></p> 
     260        <p><?php _e( 'If you&#8217;re not going to use a great site domain, leave it for a new user. Now have at it!' ); ?></p> 
    185261        <form id="setupform" method="post" action="wp-signup.php"> 
    186262                <input type="hidden" name="stage" value="gimmeanotherblog" /> 
    187263                <?php do_action( 'signup_hidden_fields' ); ?> 
    188                 <?php show_blog_form($blogname, $blog_title, $errors); ?> 
    189                 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ) ?>" /></p> 
     264                <?php show_blog_form( $blogname, $blog_title, $errors ); ?> 
     265                <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ); ?>" /></p> 
    190266        </form> 
    191267        <?php 
    192268} 
    193269 
     270/** 
     271 * {@internal Missing Short Description}} 
     272 * 
     273 * @since 3.0.0 
     274 * 
     275 * @uses validate_blog_form() 
     276 * @return bool 
     277 */ 
    194278function validate_another_blog_signup() { 
    195279        global $wpdb, $blogname, $blog_title, $errors, $domain, $path; 
    196280        $current_user = wp_get_current_user(); 
    197         if ( !is_user_logged_in() ) 
     281        if ( ! is_user_logged_in() ) 
    198282                die(); 
    199283 
    200284        $result = validate_blog_form(); 
    201         extract($result); 
     285        extract( $result ); 
    202286 
    203287        if ( $errors->get_error_code() ) { 
    204                 signup_another_blog($blogname, $blog_title, $errors); 
     288                signup_another_blog( $blogname, $blog_title, $errors ); 
    205289                return false; 
    206290        } 
    207291 
     
    210294        $meta = apply_filters( 'add_signup_meta', $meta ); 
    211295 
    212296        wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid ); 
    213         confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta); 
     297 
     298        confirm_another_blog_signup( $domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta ); 
     299 
    214300        return true; 
    215301} 
    216302 
    217 function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email = '', $meta = '') { 
     303/** 
     304 * {@internal Missing Short Description}} 
     305 * 
     306 * @since 3.0.0 
     307 * 
     308 * @todo Check for ssl 
     309 * @param string $domain 
     310 * @param string $path 
     311 * @param string $user_name 
     312 * @param string $user_email 
     313 * @param string $meta 
     314 */ 
     315function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = '' ) { 
    218316        ?> 
    219317        <h2><?php printf( __( 'The site %s is yours.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2> 
    220318        <p> 
    221                 <?php printf( __( '<a href="http://%1$s">http://%2$s</a> is your new site. <a href="%3$s">Log in</a> as &#8220;%4$s&#8221; using your existing password.' ), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name ) ?> 
     319                <?php  
     320                printf( __( '<a href="http://%1$s">http://%2$s</a> is your new site. <a href="%3$s">Log in</a> as &#8220;%4$s&#8221; using your existing password.' ), 
     321                        $domain.$path, 
     322                        $domain.$path, 
     323                        "http://" . $domain.$path . "wp-login.php", $user_name 
     324                        ); 
     325                ?> 
    222326        </p> 
    223327        <?php 
    224328        do_action( 'signup_finished' ); 
    225329} 
    226330 
    227 function signup_user($user_name = '', $user_email = '', $errors = '') { 
     331/** 
     332 * {@internal Missing Short Description}} 
     333 * 
     334 * @since 3.0.0 
     335 * 
     336 * @todo Update button styles 
     337 * @uses apply_filters() 
     338 * @param string $user_name 
     339 * @param string $user_email 
     340 * @param array $errors 
     341 */ 
     342function signup_user( $user_name = '', $user_email = '', $errors = '' ) { 
    228343        global $current_site, $active_signup; 
    229344 
    230         if ( !is_wp_error($errors) ) 
     345        if ( ! is_wp_error( $errors ) ) 
    231346                $errors = new WP_Error(); 
    232347 
    233348        $signup_for = isset( $_POST[ 'signup_for' ] ) ? esc_html( $_POST[ 'signup_for' ] ) : 'blog'; 
    234349 
    235350        // allow definition of default variables 
    236         $filtered_results = apply_filters('signup_user_init', array('user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors )); 
     351        $filtered_results = apply_filters( 'signup_user_init', array( 
     352                'user_name' => $user_name, 
     353                'user_email' => $user_email, 
     354                'errors' => $errors 
     355        ) ); 
     356 
    237357        $user_name = $filtered_results['user_name']; 
    238358        $user_email = $filtered_results['user_email']; 
    239359        $errors = $filtered_results['errors']; 
     
    241361        ?> 
    242362 
    243363        <h2><?php printf( __( 'Get your own %s account in seconds' ), $current_site->site_name ) ?></h2> 
     364 
    244365        <form id="setupform" method="post" action="wp-signup.php"> 
    245366                <input type="hidden" name="stage" value="validate-user-signup" /> 
    246367                <?php do_action( 'signup_hidden_fields' ); ?> 
     368 
    247369                <?php show_user_form($user_name, $user_email, $errors); ?> 
    248370 
    249371                <p> 
     
    260382                <?php } ?> 
    261383                </p> 
    262384 
    263                 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Next') ?>" /></p> 
    264         </form> 
     385                <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Next' ) ?>" /></p> 
     386        </form><!-- #setupform --> 
    265387        <?php 
    266388} 
    267389 
     390/** 
     391 * {@internal Missing Short Description}} 
     392 * 
     393 * @since 3.0.0 
     394 * 
     395 * @uses signup_user() 
     396 * @uses signup_blog() 
     397 * @uses wpmu_signup_user() 
     398 * @uses confirm_user_signup() 
     399 * @return bool 
     400 */ 
    268401function validate_user_signup() { 
    269402        $result = validate_user_form(); 
    270         extract($result); 
     403        extract( $result ); 
    271404 
    272405        if ( $errors->get_error_code() ) { 
    273                 signup_user($user_name, $user_email, $errors); 
     406                signup_user( $user_name, $user_email, $errors ); 
    274407                return false; 
    275408        } 
    276409 
    277410        if ( 'blog' == $_POST['signup_for'] ) { 
    278                 signup_blog($user_name, $user_email); 
     411                signup_blog( $user_name, $user_email ); 
    279412                return false; 
    280413        } 
    281414 
    282         wpmu_signup_user($user_name, $user_email, apply_filters( 'add_signup_meta', array() ) ); 
     415        wpmu_signup_user( $user_name, $user_email, apply_filters( 'add_signup_meta', array() ) ); 
    283416 
    284         confirm_user_signup($user_name, $user_email); 
     417        confirm_user_signup( $user_name, $user_email ); 
    285418        return true; 
    286419} 
    287420 
    288 function confirm_user_signup($user_name, $user_email) { 
     421/** 
     422 * {@internal Missing Short Description}} 
     423 * 
     424 * @since 3.0.0 
     425 * 
     426 * @param string $user_name 
     427 * @param string $user_email 
     428 */ 
     429function confirm_user_signup( $user_name, $user_email ) { 
    289430        ?> 
    290431        <h2><?php printf( __( '%s is your new username' ), $user_name) ?></h2> 
    291432        <p><?php _e( 'But, before you can start using your new username, <strong>you must activate it</strong>.' ) ?></p> 
     
    295436        do_action( 'signup_finished' ); 
    296437} 
    297438 
    298 function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') { 
    299         if ( !is_wp_error($errors) ) 
     439/** 
     440 * {@internal Missing Short Description}} 
     441 * 
     442 * @since 3.0.0 
     443 * 
     444 * @uses apply_filters() 
     445 * @uses show_blog_form() 
     446 * @param string $user_name 
     447 * @param string $user_email 
     448 * @param string $blogname 
     449 * @param string $blog_title 
     450 * @param array $errors 
     451 */ 
     452function signup_blog( $user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '' ) { 
     453        if ( ! is_wp_error( $errors ) ) 
    300454                $errors = new WP_Error(); 
    301455 
    302456        // allow definition of default variables 
    303         $filtered_results = apply_filters('signup_blog_init', array('user_name' => $user_name, 'user_email' => $user_email, 'blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); 
     457        $filtered_results = apply_filters( 'signup_blog_init', array(  
     458                'user_name' => $user_name, 
     459                'user_email' => $user_email, 
     460                'blogname' => $blogname, 
     461                'blog_title' => $blog_title, 
     462                'errors' => $errors 
     463        ) ); 
     464         
    304465        $user_name = $filtered_results['user_name']; 
    305466        $user_email = $filtered_results['user_email']; 
    306467        $blogname = $filtered_results['blogname']; 
    307468        $blog_title = $filtered_results['blog_title']; 
    308469        $errors = $filtered_results['errors']; 
    309470 
    310         if ( empty($blogname) ) 
     471        if ( empty( $blogname ) ) 
    311472                $blogname = $user_name; 
    312473        ?> 
    313474        <form id="setupform" method="post" action="wp-signup.php"> 
     
    315476                <input type="hidden" name="user_name" value="<?php echo esc_attr($user_name) ?>" /> 
    316477                <input type="hidden" name="user_email" value="<?php echo esc_attr($user_email) ?>" /> 
    317478                <?php do_action( 'signup_hidden_fields' ); ?> 
    318                 <?php show_blog_form($blogname, $blog_title, $errors); ?> 
    319                 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Signup') ?>" /></p> 
    320         </form> 
     479                <?php show_blog_form( $blogname, $blog_title, $errors ); ?> 
     480                <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Signup' ) ?>" /></p> 
     481        </form><!-- #setupform --> 
    321482        <?php 
    322483} 
    323484 
     485/** 
     486 * {@internal Missing Short Description}} 
     487 * 
     488 * @since 3.0.0 
     489 * 
     490 * @uses wpmu_validate_user_signup() 
     491 * @uses wpmu_validate_blog_signup() 
     492 * @uses signup_user() 
     493 * @uses signup_blog() 
     494 * @uses apply_filters() 
     495 * @return bool 
     496 */ 
    324497function validate_blog_signup() { 
    325498        // Re-validate user info. 
    326         $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']); 
    327         extract($result); 
     499        $result = wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] ); 
     500        extract( $result ); 
    328501 
    329502        if ( $errors->get_error_code() ) { 
    330                 signup_user($user_name, $user_email, $errors); 
     503                signup_user( $user_name, $user_email, $errors ); 
    331504                return false; 
    332505        } 
    333506 
    334         $result = wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title']); 
    335         extract($result); 
     507        $result = wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'] ); 
     508        extract( $result ); 
    336509 
    337510        if ( $errors->get_error_code() ) { 
    338                 signup_blog($user_name, $user_email, $blogname, $blog_title, $errors); 
     511                signup_blog( $user_name, $user_email, $blogname, $blog_title, $errors ); 
    339512                return false; 
    340513        } 
    341514 
     
    343516        $meta = array ('lang_id' => 1, 'public' => $public); 
    344517        $meta = apply_filters( 'add_signup_meta', $meta ); 
    345518 
    346         wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta); 
    347         confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta); 
     519        wpmu_signup_blog( $domain, $path, $blog_title, $user_name, $user_email, $meta ); 
     520        confirm_blog_signup( $domain, $path, $blog_title, $user_name, $user_email, $meta ); 
    348521        return true; 
    349522} 
    350523 
    351 function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user_email = '', $meta) { 
     524/** 
     525 * {@internal Missing Short Description}} 
     526 * 
     527 * @since 3.0.0 
     528 * 
     529 * @param string $domain 
     530 * @param string $path 
     531 * @param string $blog_title 
     532 * @param string $user_name 
     533 * @param string $user_email 
     534 * @param string $meta 
     535 */ 
     536function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta ) { 
    352537        ?> 
    353538        <h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2> 
    354539 
    355540        <p><?php _e( 'But, before you can start using your site, <strong>you must activate it</strong>.' ) ?></p> 
    356         <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ),  $user_email) ?></p> 
     541        <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ),  $user_email ) ?></p> 
    357542        <p><?php _e( 'If you do not activate your site within two days, you will have to sign up again.' ); ?></p> 
    358543        <h2><?php _e( 'Still waiting for your email?' ); ?></h2> 
    359544        <p> 
     
    362547                        <li><p><strong><?php _e( 'Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.' ) ?></strong></p></li> 
    363548                        <li><p><?php _e( 'Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.' ) ?></p></li> 
    364549                        <li><?php printf( __( 'Have you entered your email correctly?  You have entered %s, if it&#8217;s incorrect, you will not receive your email.' ), $user_email ) ?></li> 
    365                 </ul> 
     550                </ul><!-- .noemail-tips --> 
    366551        </p> 
    367552        <?php 
    368553        do_action( 'signup_finished' ); 
     
    370555 
    371556// Main 
    372557$active_signup = get_site_option( 'registration' ); 
    373 if ( !$active_signup ) 
     558if ( ! $active_signup ) 
    374559        $active_signup = 'all'; 
    375560 
    376561$active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" 
    377562 
    378563// Make the signup type translatable. 
    379 $i18n_signup['all'] = _x('all', 'Multisite active signup type'); 
    380 $i18n_signup['none'] = _x('none', 'Multisite active signup type'); 
    381 $i18n_signup['blog'] = _x('blog', 'Multisite active signup type'); 
    382 $i18n_signup['user'] = _x('user', 'Multisite active signup type'); 
     564$i18n_signup['all'] = _x( 'all', 'Multisite active signup type' ); 
     565$i18n_signup['none'] = _x( 'none', 'Multisite active signup type' ); 
     566$i18n_signup['blog'] = _x( 'blog', 'Multisite active signup type' ); 
     567$i18n_signup['user'] = _x( 'user', 'Multisite active signup type' ); 
    383568 
    384 if ( is_super_admin() ) 
    385         echo '<div class="mu_alert">' . sprintf( __( 'Greetings Site Administrator! You are currently allowing &#8220;%s&#8221; registrations. To change or disable registration go to your <a href="%s">Options page</a>.' ), $i18n_signup[$active_signup], esc_url( network_admin_url( 'settings.php' ) ) ) . '</div>'; 
     569if ( is_super_admin() ) { 
     570        $allowed_registrations = sprintf( __( 'Greetings Site Administrator! You are currently allowing &#8220;%s&#8221; registrations. To change or disable registration go to your <a href="%s">Options page</a>.' ), 
     571                $i18n_signup[$active_signup], 
     572                esc_url( network_admin_url( 'settings.php' ) 
     573        ); 
     574        printf( '<div class="mu_alert">%s</div>', $allowed_registrations ); 
     575} 
    386576 
    387577$newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null; 
    388578 
    389579$current_user = wp_get_current_user(); 
    390580if ( $active_signup == 'none' ) { 
    391581        _e( 'Registration has been disabled.' ); 
    392 } elseif ( $active_signup == 'blog' && !is_user_logged_in() ) { 
     582} elseif ( $active_signup == 'blog' && ! is_user_logged_in() ) { 
    393583        $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( network_site_url( 'wp-signup.php' ) ) ); 
    394         echo sprintf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url ); 
     584        printf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url ); 
    395585} else { 
    396         $stage = isset( $_POST['stage'] ) ?  $_POST['stage'] : 'default'; 
     586        $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default'; 
    397587        switch ( $stage ) { 
    398588                case 'validate-user-signup' : 
    399                         if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' ) 
     589                        if ( $active_signup == 'all'  
     590                                || ( $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' )  
     591                                || ( $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' ) ) 
    400592                                validate_user_signup(); 
    401593                        else 
    402594                                _e( 'User registration has been disabled.' ); 
     
    415607                        $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : ''; 
    416608                        do_action( 'preprocess_signup_form' ); // populate the form from invites, elsewhere? 
    417609                        if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) 
    418                                 signup_another_blog($newblogname); 
    419                         elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) ) 
     610                                signup_another_blog( $newblogname ); 
     611                        elseif ( ! is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'user' ) ) 
    420612                                signup_user( $newblogname, $user_email ); 
    421                         elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) ) 
     613                        elseif ( ! is_user_logged_in() && ( $active_signup == 'blog' ) ) 
    422614                                _e( 'Sorry, new registrations are not allowed at this time.' ); 
    423615                        else 
    424616                                _e( 'You are logged in already. No need to register again!' ); 
     
    435627        } 
    436628} 
    437629?> 
    438 </div> 
    439 </div> 
     630</div><!-- .mu_register --> 
     631</div><!-- #content --> 
    440632<?php do_action( 'after_signup_form' ); ?> 
    441633 
    442634<?php get_footer(); ?> 
  • wp-includes/default-filters.php

     
    213213add_action( 'wp_print_footer_scripts', '_wp_footer_scripts'                 ); 
    214214add_action( 'init',                'check_theme_switched',            99    ); 
    215215add_action( 'after_switch_theme',  '_wp_sidebars_changed'                   ); 
     216add_action( 'signup_header',       'wpmu_signup_stylesheet'                 ); 
    216217 
    217218if ( isset( $_GET['replytocom'] ) ) 
    218219    add_action( 'wp_head', 'wp_no_robots' );