Make WordPress Core


Ignore:
Timestamp:
01/05/2016 04:41:43 PM (11 years ago)
Author:
ocean90
Message:

Install: Only enqueue scripts when necessary.

Props flixos90 for initial patch.
Fixes #34700.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/install.php

    r35837 r36176  
    262262}
    263263
     264$scripts_to_print = array( 'jquery' );
     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">';
     
    283285                        }
    284286                }
     287
     288                $scripts_to_print[] = 'user-profile';
    285289
    286290                display_header();
     
    305309                if ( ! empty( $wpdb->error ) )
    306310                        wp_die( $wpdb->error->get_error_message() );
     311
     312                $scripts_to_print[] = 'user-profile';
    307313
    308314                display_header();
     
    369375                break;
    370376}
    371 if ( !wp_is_mobile() ) {
    372 ?>
     377
     378if ( ! wp_is_mobile() ) {
     379        ?>
    373380<script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
    374 <?php } ?>
    375 <?php wp_print_scripts( 'user-profile' ); ?>
    376 <?php wp_print_scripts( 'language-chooser' ); ?>
     381        <?php
     382}
     383
     384wp_print_scripts( $scripts_to_print );
     385?>
    377386<script type="text/javascript">
    378387jQuery( function( $ ) {
Note: See TracChangeset for help on using the changeset viewer.