Make WordPress Core

Ticket #34700: 34700.3.diff

File 34700.3.diff, 1.5 KB (added by ocean90, 10 years ago)
  • src/wp-admin/install.php

     
    261261        $language = $GLOBALS['wp_local_package'];
    262262}
    263263
     264$scripts_to_print = array();
     265
    264266switch($step) {
    265267        case 0: // Step 0
    266 
    267268                if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) {
     269                        $scripts_to_print[] = 'language-chooser';
    268270                        display_header( 'language-chooser' );
    269271                        echo '<form id="setup" method="post" action="?step=1">';
    270272                        wp_install_language_form( $languages );
     
    283285                        }
    284286                }
    285287
     288                $scripts_to_print[] = 'user-profile';
     289
    286290                display_header();
    287291?>
    288292<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>
     
    305309                if ( ! empty( $wpdb->error ) )
    306310                        wp_die( $wpdb->error->get_error_message() );
    307311
     312                $scripts_to_print[] = 'user-profile';
     313
    308314                display_header();
    309315                // Fill in the data we gathered
    310316                $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
     
    372378?>
    373379<script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
    374380<?php } ?>
    375 <?php wp_print_scripts( 'user-profile' ); ?>
    376 <?php wp_print_scripts( 'language-chooser' ); ?>
     381<?php
     382if ( $scripts_to_print ) {
     383        wp_print_scripts( $scripts_to_print );
     384?>
    377385<script type="text/javascript">
    378386jQuery( function( $ ) {
    379387        $( '.hide-if-no-js' ).removeClass( 'hide-if-no-js' );
    380388} );
    381389</script>
     390<?php }
     391?>
    382392</body>
    383393</html>