Make WordPress Core

Ticket #28351: 28351-4.diff

File 28351-4.diff, 6.7 KB (added by igmoweb, 9 years ago)
  • src/wp-signup.php

     
    109109                        $site = $current_site->domain . $current_site->path . __( 'sitename' );
    110110                else
    111111                        $site = __( 'domain' ) . '.' . $site_domain . $current_site->path;
    112                 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>';
     112                echo '<p>(<strong>' . sprintf( __('Your address will be %s.'), $site ) . '</strong>) ' . apply_filters( 'signup_blogname_text', __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) ) . '</p>';
    113113        }
    114114
    115115        // Blog Title
     
    179179                echo '<p class="error">'.$errmsg.'</p>';
    180180        }
    181181        echo '<input name="user_name" type="text" id="user_name" value="'. esc_attr($user_name) .'" maxlength="60" /><br />';
    182         _e( '(Must be at least 4 characters, letters and numbers only.)' );
     182        echo apply_filters( 'signup_username_text', __( '(Must be at least 4 characters, letters and numbers only.)' ) );
    183183        ?>
    184184
    185185        <label for="user_email"><?php _e( 'Email&nbsp;Address:' ) ?></label>
     
    186186        <?php if ( $errmsg = $errors->get_error_message('user_email') ) { ?>
    187187                <p class="error"><?php echo $errmsg ?></p>
    188188        <?php } ?>
    189         <input name="user_email" type="email" 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.)') ?>
     189        <input name="user_email" type="email" id="user_email" value="<?php  echo esc_attr($user_email) ?>" maxlength="200" /><br /><?php echo apply_filters( 'signup_email_text', __('We send your registration email to this address. (Double-check your email address before continuing.)') ) ?>
    190190        <?php
    191191        if ( $errmsg = $errors->get_error_message('generic') ) {
    192192                echo '<p class="error">' . $errmsg . '</p>';
     
    493493 * @param string $user_name The username
    494494 * @param string $user_email The user's email address
    495495 */
    496 function confirm_user_signup($user_name, $user_email) {
    497         ?>
    498         <h2><?php printf( __( '%s is your new username' ), $user_name) ?></h2>
    499         <p><?php _e( 'But, before you can start using your new username, <strong>you must activate it</strong>.' ) ?></p>
    500         <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ), $user_email ); ?></p>
    501         <p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p>
    502         <?php
     496function confirm_user_signup( $user_name, $user_email ) {
     497        $message =
     498        "<h2>" . sprintf( __( '%s is your new username' ), $user_name ) . "</h2>
     499        <p>" . _( 'But, before you can start using your new username, <strong>you must activate it</strong>.' ) . "</p>
     500        <p>" . sprintf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ), $user_email ) . "</p>
     501        <p>" . _( 'If you do not activate your username within two days, you will have to sign up again.' ) . "</p>";
     502       
     503        /**
     504         * Filter the user signup confirmation message
     505         *
     506         * @since 4.2
     507         *
     508         * @param string $message The default message
     509         * @param string $user_name The username
     510         * @param string $user_email The user's email address
     511         */
     512        echo apply_filters( 'confirm_user_signup', $message, $user_name, $user_email );
     513
    503514        /** This action is documented in wp-signup.php */
    504515        do_action( 'signup_finished' );
    505516}
     
    622633 * @param array $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
    623634 */
    624635function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) {
    625         ?>
    626         <h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>
     636        $message =
     637        "<h2>" . sprintf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) . "</h2>
     638        <p>" . _( 'But, before you can start using your site, <strong>you must activate it</strong>.' ) . "</p>
     639        <p>" . sprintf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ),  $user_email ) . "</p>
     640        <p>" . _( 'If you do not activate your site within two days, you will have to sign up again.' ) . "</p>
     641        <h2>" . _( 'Still waiting for your email?' ) . "</h2>
     642        <p>" .
     643                _( 'If you haven&#8217;t received your email yet, there are a number of things you can do:' )
     644                . "<ul id='noemail-tips'>
     645                        <li><p><strong>" . _( 'Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.' ) . "</strong></p></li>
     646                        <li><p>" . _( 'Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.' ) . "</p></li>
     647                        <li>" . sprintf( __( 'Have you entered your email correctly? You have entered %s, if it&#8217;s incorrect, you will not receive your email.' ), $user_email ) . "</li>
     648                </ul>
     649        </p>";
    627650
    628         <p><?php _e( 'But, before you can start using your site, <strong>you must activate it</strong>.' ) ?></p>
    629         <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ),  $user_email) ?></p>
    630         <p><?php _e( 'If you do not activate your site within two days, you will have to sign up again.' ); ?></p>
    631         <h2><?php _e( 'Still waiting for your email?' ); ?></h2>
    632         <p>
    633                 <?php _e( 'If you haven&#8217;t received your email yet, there are a number of things you can do:' ) ?>
    634                 <ul id="noemail-tips">
    635                         <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>
    636                         <li><p><?php _e( 'Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.' ) ?></p></li>
    637                         <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>
    638                 </ul>
    639         </p>
    640         <?php
     651        /**
     652         * Filter the blog signup confirmation message
     653         *
     654         * @since 4.2
     655         *
     656         * @param string $message The domain URL
     657         * @param string $domain The domain URL
     658         * @param string $path The site root path
     659         * @param string $blog_title The new site title
     660         * @param string $user_name, The username
     661         * @param string $user_email The user's email address
     662         * @param array $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
     663         */
     664        echo apply_filters( 'confirm_blog_signup', $message, $domain, $path, $blog_title, $user_name, $user_email, $meta );
    641665        /** This action is documented in wp-signup.php */
    642666        do_action( 'signup_finished' );
    643667}