mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 21:24:35 +00:00
Move utils.js (cookie and user setting functions) to wp-includes to enable front-end use.
Make it a dependency of media-views (and therefore media-editor). Move its userSettings JS object from admin-header to being paired with the script in script loader. see #22730. git-svn-id: https://develop.svn.wordpress.org/trunk@23036 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -59,7 +59,12 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
||||
|
||||
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js" );
|
||||
$scripts->add( 'utils', "/wp-includes/js/utils$suffix.js" );
|
||||
did_action( 'init' ) && $scripts->localize( 'utils', 'userSettings', array(
|
||||
'url' => (string) SITECOOKIEPATH,
|
||||
'uid' => (string) get_current_user_id(),
|
||||
'time' => (string) time(),
|
||||
) );
|
||||
|
||||
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array(
|
||||
@@ -329,7 +334,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
// To enqueue media-views or media-editor, call wp_enqueue_media().
|
||||
// Both rely on numerous settings, styles, and templates to operate correctly.
|
||||
$scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'media-models', 'wp-plupload', 'jquery-ui-sortable' ), false, 1 );
|
||||
$scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable' ), false, 1 );
|
||||
$scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 );
|
||||
$scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models' ), false, 1 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user