WordPress.org

Make WordPress Core

Ticket #22730: 22730.2.diff

File 22730.2.diff, 2.5 KB (added by nacin, 5 years ago)
  • wp-includes/script-loader.php

     
    5959
    6060        $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    6161
    62         $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js" );
     62        $scripts->add( 'utils', "/wp-includes/js/utils$suffix.js" );
     63        did_action( 'init' ) && $scripts->localize( 'utils', 'userSettings', array(
     64                'url' => (string) SITECOOKIEPATH,
     65                'uid' => (string) get_current_user_id(),
     66                'time' => (string) time(),
     67        ) );
    6368
    6469        $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 );
    6570        did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array(
     
    329334
    330335        // To enqueue media-views or media-editor, call wp_enqueue_media().
    331336        // Both rely on numerous settings, styles, and templates to operate correctly.
    332         $scripts->add( 'media-views',  "/wp-includes/js/media-views$suffix.js",  array( 'media-models', 'wp-plupload', 'jquery-ui-sortable' ), false, 1 );
     337        $scripts->add( 'media-views',  "/wp-includes/js/media-views$suffix.js",  array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable' ), false, 1 );
    333338        $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 );
    334339        $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models' ), false, 1 );
    335340
  • wp-admin/admin-header.php

     
    5050?>
    5151<script type="text/javascript">
    5252addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    53 var userSettings = {
    54                 'url': '<?php echo SITECOOKIEPATH; ?>',
    55                 'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',
    56                 'time':'<?php echo time() ?>'
    57         },
    58         ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
     53var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
    5954        pagenow = '<?php echo $current_screen->id; ?>',
    6055        typenow = '<?php echo $current_screen->post_type; ?>',
    6156        adminpage = '<?php echo $admin_body_class; ?>',