Make WordPress Core

Ticket #28351: wp-signup.patch

File wp-signup.patch, 2.5 KB (added by UmeshSingla, 11 years ago)

Added filters to display a custom signup confirmation message for User or Blog registration

  • wp-signup.php

     
    504504 * @param string $user_email The user's email address
    505505 */
    506506function confirm_user_signup($user_name, $user_email) {
    507         ?>
    508         <h2><?php printf( __( '%s is your new username' ), $user_name) ?></h2>
    509         <p><?php _e( 'But, before you can start using your new username, <strong>you must activate it</strong>.' ) ?></p>
    510         <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ), $user_email ); ?></p>
    511         <p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p>
     507        /**
     508         * Filter the user signup confirmation message
     509         *
     510         * @since 4.0
     511         *
     512         * @param string $message
     513         * @param string $user_name, The username
     514         * @param string $user_email The user's email address
     515         */
     516        $message = apply_filters( 'confirm_user_signup', $message = '', $user_name, $user_email );
     517        if( $message ){
     518                echo $message;
     519        }else {
     520                ?>
     521                <h2><?php printf( __( '%s is your new username' ), $user_name ) ?></h2>
     522                <p><?php _e( 'But, before you can start using your new username, <strong>you must activate it</strong>.' ) ?></p>
     523                <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ), $user_email ); ?></p>
     524                <p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p>
    512525        <?php
     526        }
    513527        /** This action is documented in wp-signup.php */
    514528        do_action( 'signup_finished' );
    515529}
     
    639653 * @param array $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
    640654 */
    641655function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) {
     656        /**
     657         * Filter the blog signup confirmation message
     658         *
     659         * @since 4.0
     660         *
     661         * @param string $domain The domain URL
     662         * @param string $path The site root path
     663         * @param string $blog_title The new site title
     664         * @param string $user_name, The username
     665         * @param string $user_email The user's email address
     666         * @param array $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
     667         */
     668}
     669        $message = apply_filters( 'confirm_blog_signup', '', $domain, $path, $blog_title, $user_name, $user_email, $meta );
     670        if ( $message ) {
     671                echo $message;
     672        } else {
    642673        ?>
    643674        <h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>
    644675