WordPress.org

Make WordPress Core

Ticket #6479: 6479.2.patch

File 6479.2.patch, 3.2 KB (added by tyxla, 5 years ago)

Adding tagline field to installation main step.

  • src/wp-admin/includes/upgrade.php

     
    3434 * @param string $deprecated    Optional. Not used.
    3535 * @param string $user_password Optional. User's chosen password. Default empty (random password).
    3636 * @param string $language      Optional. Language chosen. Default empty.
     37 * @param string $blog_tagline  Blog tagline.
    3738 * @return array Array keys 'url', 'user_id', 'password', and 'password_message'.
    3839 */
    39 function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '', $language = '' ) {
     40function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '', $language = '', $blog_tagline = '' ) {
    4041        if ( !empty( $deprecated ) )
    4142                _deprecated_argument( __FUNCTION__, '2.6' );
    4243
     
    5455                update_option( 'WPLANG', $language );
    5556        }
    5657
     58        if ( $blog_tagline ) {
     59                update_option( 'blogdescription', $blog_tagline );
     60        }
     61
    5762        $guessurl = wp_guess_url();
    5863
    5964        update_option('siteurl', $guessurl);
  • src/wp-admin/install.php

     
    101101        }
    102102
    103103        $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
     104        $weblog_tagline = isset( $_POST['weblog_tagline'] ) ? trim( wp_unslash( $_POST['weblog_tagline'] ) ) : '';
    104105        $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
    105106        $admin_email  = isset( $_POST['admin_email']  ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
    106107
     
    115116                        <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo esc_attr( $weblog_title ); ?>" /></td>
    116117                </tr>
    117118                <tr>
     119                        <th scope="row"><label for="weblog_tagline"><?php _e( 'Site Tagline' ); ?></label></th>
     120                        <td><input name="weblog_tagline" type="text" id="weblog_tagline" size="25" value="<?php echo esc_attr( $weblog_tagline ); ?>" /></td>
     121                </tr>
     122                <tr>
    118123                        <th scope="row"><label for="user_login"><?php _e('Username'); ?></label></th>
    119124                        <td>
    120125                        <?php
     
    306311                display_header();
    307312                // Fill in the data we gathered
    308313                $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
     314                $weblog_tagline = isset( $_POST['weblog_tagline'] ) ? trim( wp_unslash( $_POST['weblog_tagline'] ) ) : '';
    309315                $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
    310316                $admin_password = isset($_POST['admin_password']) ? wp_unslash( $_POST['admin_password'] ) : '';
    311317                $admin_password_check = isset($_POST['admin_password2']) ? wp_unslash( $_POST['admin_password2'] ) : '';
     
    337343
    338344                if ( $error === false ) {
    339345                        $wpdb->show_errors();
    340                         $result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language );
     346                        $result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language, $weblog_tagline );
    341347?>
    342348
    343349<h1><?php _e( 'Success!' ); ?></h1>