~canonical-sysadmins/wordpress/5.1

« back to all changes in this revision

Viewing changes to wp-includes/script-loader.php

  • Committer: Barry Price
  • Date: 2019-02-22 03:51:26 UTC
  • mfrom: (1.2.12 upstream)
  • Revision ID: barry.price@canonical.com-20190222035126-o28k38qs8jfyjsxt
Merge WP5.1 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        script_concat_settings();
50
50
 
51
51
        $compressed = $compress_scripts && $concatenate_scripts && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] )
52
 
                      && false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ! $force_uncompressed;
 
52
                                  && false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ! $force_uncompressed;
53
53
 
54
54
        // Load tinymce.js when running from /src, otherwise load wp-tinymce.js.gz (in production) or
55
55
        // tinymce.min.js (when SCRIPT_DEBUG is true).
56
56
        if ( $compressed ) {
57
 
                $scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . 'wp-tinymce.php', array(), $tinymce_version );
 
57
                $scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . 'wp-tinymce.js', array(), $tinymce_version );
58
58
        } else {
59
59
                $scripts->add( 'wp-tinymce-root', includes_url( 'js/tinymce/' ) . "tinymce$dev_suffix.js", array(), $tinymce_version );
60
60
                $scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . "plugins/compat3x/plugin$dev_suffix.js", array( 'wp-tinymce-root' ), $tinymce_version );
79
79
        $suffix = wp_scripts_get_suffix();
80
80
 
81
81
        $vendor_scripts = array(
82
 
                'react' => array( 'wp-polyfill' ),
 
82
                'react'     => array( 'wp-polyfill' ),
83
83
                'react-dom' => array( 'react' ),
84
84
                'moment',
85
85
                'lodash',
91
91
        );
92
92
 
93
93
        $vendor_scripts_versions = array(
94
 
                'react' => '16.6.3',
95
 
                'react-dom' => '16.6.3',
96
 
                'moment' => '2.22.2',
97
 
                'lodash' => '4.17.11',
98
 
                'wp-polyfill-fetch' => '3.0.0',
99
 
                'wp-polyfill-formdata' => '3.0.12',
100
 
                'wp-polyfill-node-contains' => '3.26.0-0',
 
94
                'react'                       => '16.6.3',
 
95
                'react-dom'                   => '16.6.3',
 
96
                'moment'                      => '2.22.2',
 
97
                'lodash'                      => '4.17.11',
 
98
                'wp-polyfill-fetch'           => '3.0.0',
 
99
                'wp-polyfill-formdata'        => '3.0.12',
 
100
                'wp-polyfill-node-contains'   => '3.26.0-0',
101
101
                'wp-polyfill-element-closest' => '2.0.2',
102
 
                'wp-polyfill' => '7.0.0',
 
102
                'wp-polyfill'                 => '7.0.0',
103
103
        );
104
104
 
105
105
        foreach ( $vendor_scripts as $handle => $dependencies ) {
106
106
                if ( is_string( $dependencies ) ) {
107
 
                        $handle = $dependencies;
 
107
                        $handle       = $dependencies;
108
108
                        $dependencies = array();
109
109
                }
110
110
 
224
224
        $suffix = wp_scripts_get_suffix();
225
225
 
226
226
        $packages_versions = array(
227
 
                'api-fetch' => '2.2.7',
228
 
                'a11y' => '2.0.2',
229
 
                'annotations' => '1.0.5',
230
 
                'autop' => '2.0.2',
231
 
                'blob' => '2.1.0',
232
 
                'block-library' => '2.2.12',
233
 
                'block-serialization-default-parser' => '2.0.3',
234
 
                'blocks' => '6.0.5',
235
 
                'components' => '7.0.5',
236
 
                'compose' => '3.0.0',
237
 
                'core-data' => '2.0.16',
238
 
                'data' => '4.2.0',
239
 
                'date' => '3.0.1',
240
 
                'deprecated' => '2.0.4',
241
 
                'dom' => '2.0.8',
242
 
                'dom-ready' => '2.0.2',
243
 
                'edit-post' => '3.1.7',
244
 
                'editor' => '9.0.7',
245
 
                'element' => '2.1.8',
246
 
                'escape-html' => '1.0.1',
247
 
                'format-library' => '1.2.10',
248
 
                'hooks' => '2.0.4',
249
 
                'html-entities' => '2.0.4',
250
 
                'i18n' => '3.1.0',
251
 
                'is-shallow-equal' => '1.1.4',
252
 
                'keycodes' => '2.0.5',
253
 
                'list-reusable-blocks' => '1.1.18',
254
 
                'notices' => '1.1.2',
255
 
                'nux' => '3.0.6',
256
 
                'plugins' => '2.0.10',
257
 
                'redux-routine' => '3.0.3',
258
 
                'rich-text' => '3.0.4',
259
 
                'shortcode' => '2.0.2',
260
 
                'token-list' => '1.1.0',
261
 
                'url' => '2.3.3',
262
 
                'viewport' => '2.1.0',
263
 
                'wordcount' => '2.0.3',
 
227
                'api-fetch'                          => '2.2.8',
 
228
                'a11y'                               => '2.0.2',
 
229
                'annotations'                        => '1.0.8',
 
230
                'autop'                              => '2.0.2',
 
231
                'blob'                               => '2.1.0',
 
232
                'block-library'                      => '2.2.16',
 
233
                'block-serialization-default-parser' => '2.0.5',
 
234
                'blocks'                             => '6.0.6',
 
235
                'components'                         => '7.0.8',
 
236
                'compose'                            => '3.0.1',
 
237
                'core-data'                          => '2.0.17',
 
238
                'data'                               => '4.2.1',
 
239
                'date'                               => '3.0.1',
 
240
                'deprecated'                         => '2.0.5',
 
241
                'dom'                                => '2.0.8',
 
242
                'dom-ready'                          => '2.0.2',
 
243
                'edit-post'                          => '3.1.11',
 
244
                'editor'                             => '9.0.11',
 
245
                'element'                            => '2.1.9',
 
246
                'escape-html'                        => '1.0.1',
 
247
                'format-library'                     => '1.2.14',
 
248
                'hooks'                              => '2.0.5',
 
249
                'html-entities'                      => '2.0.4',
 
250
                'i18n'                               => '3.1.1',
 
251
                'is-shallow-equal'                   => '1.1.5',
 
252
                'keycodes'                           => '2.0.6',
 
253
                'list-reusable-blocks'               => '1.1.21',
 
254
                'notices'                            => '1.1.3',
 
255
                'nux'                                => '3.0.9',
 
256
                'plugins'                            => '2.0.10',
 
257
                'redux-routine'                      => '3.0.4',
 
258
                'rich-text'                          => '3.0.7',
 
259
                'shortcode'                          => '2.0.2',
 
260
                'token-list'                         => '1.1.0',
 
261
                'url'                                => '2.3.3',
 
262
                'viewport'                           => '2.1.1',
 
263
                'wordcount'                          => '2.0.3',
264
264
        );
265
265
 
266
266
        $packages_dependencies = array(
267
 
                'api-fetch' => array( 'wp-polyfill', 'wp-hooks', 'wp-i18n', 'wp-url' ),
268
 
                'a11y' => array( 'wp-dom-ready', 'wp-polyfill' ),
269
 
                'annotations' => array(
 
267
                'api-fetch'                          => array( 'wp-polyfill', 'wp-hooks', 'wp-i18n', 'wp-url' ),
 
268
                'a11y'                               => array( 'wp-dom-ready', 'wp-polyfill' ),
 
269
                'annotations'                        => array(
270
270
                        'wp-data',
271
271
                        'wp-hooks',
272
272
                        'wp-i18n',
273
273
                        'wp-polyfill',
274
274
                        'wp-rich-text',
275
275
                ),
276
 
                'autop' => array( 'wp-polyfill' ),
277
 
                'blob' => array( 'wp-polyfill' ),
278
 
                'blocks' => array(
 
276
                'autop'                              => array( 'wp-polyfill' ),
 
277
                'blob'                               => array( 'wp-polyfill' ),
 
278
                'blocks'                             => array(
279
279
                        'wp-autop',
280
280
                        'wp-blob',
281
281
                        'wp-block-serialization-default-parser',
290
290
                        'wp-shortcode',
291
291
                        'lodash',
292
292
                ),
293
 
                'block-library' => array(
 
293
                'block-library'                      => array(
294
294
                        'editor',
295
295
                        'lodash',
296
296
                        'wp-api-fetch',
313
313
                        'wp-rich-text',
314
314
                ),
315
315
                'block-serialization-default-parser' => array(),
316
 
                'components' => array(
 
316
                'components'                         => array(
317
317
                        'lodash',
318
318
                        'moment',
319
319
                        'wp-a11y',
330
330
                        'wp-rich-text',
331
331
                        'wp-url',
332
332
                ),
333
 
                'compose' => array(
 
333
                'compose'                            => array(
334
334
                        'lodash',
335
335
                        'wp-element',
336
336
                        'wp-is-shallow-equal',
337
 
                        'wp-polyfill'
 
337
                        'wp-polyfill',
338
338
                ),
339
 
                'core-data' => array( 'wp-data', 'wp-api-fetch', 'wp-polyfill', 'wp-url', 'lodash' ),
340
 
                'data' => array(
 
339
                'core-data'                          => array( 'wp-data', 'wp-api-fetch', 'wp-polyfill', 'wp-url', 'lodash' ),
 
340
                'data'                               => array(
341
341
                        'lodash',
342
342
                        'wp-compose',
343
343
                        'wp-element',
345
345
                        'wp-polyfill',
346
346
                        'wp-redux-routine',
347
347
                ),
348
 
                'date' => array( 'moment', 'wp-polyfill' ),
349
 
                'deprecated' => array( 'wp-polyfill', 'wp-hooks' ),
350
 
                'dom' => array( 'lodash', 'wp-polyfill', 'wp-tinymce' ),
351
 
                'dom-ready' => array( 'wp-polyfill' ),
352
 
                'edit-post' => array(
 
348
                'date'                               => array( 'moment', 'wp-polyfill' ),
 
349
                'deprecated'                         => array( 'wp-polyfill', 'wp-hooks' ),
 
350
                'dom'                                => array( 'lodash', 'wp-polyfill', 'wp-tinymce' ),
 
351
                'dom-ready'                          => array( 'wp-polyfill' ),
 
352
                'edit-post'                          => array(
353
353
                        'jquery',
354
354
                        'lodash',
355
355
                        'postbox',
376
376
                        'wp-url',
377
377
                        'wp-viewport',
378
378
                ),
379
 
                'editor' => array(
 
379
                'editor'                             => array(
380
380
                        'jquery',
381
381
                        'lodash',
382
 
                        'wp-tinymce-lists',
383
382
                        'wp-a11y',
384
383
                        'wp-api-fetch',
385
384
                        'wp-blob',
407
406
                        'wp-wordcount',
408
407
                        'wp-rich-text',
409
408
                ),
410
 
                'element' => array( 'wp-polyfill', 'react', 'react-dom', 'lodash', 'wp-escape-html' ),
411
 
                'escape-html' => array( 'wp-polyfill' ),
412
 
                'format-library' => array(
 
409
                'element'                            => array( 'wp-polyfill', 'react', 'react-dom', 'lodash', 'wp-escape-html' ),
 
410
                'escape-html'                        => array( 'wp-polyfill' ),
 
411
                'format-library'                     => array(
413
412
                        'wp-components',
414
413
                        'wp-dom',
415
414
                        'wp-editor',
420
419
                        'wp-rich-text',
421
420
                        'wp-url',
422
421
                ),
423
 
                'hooks' => array( 'wp-polyfill' ),
424
 
                'html-entities' => array( 'wp-polyfill' ),
425
 
                'i18n' => array( 'wp-polyfill' ),
426
 
                'is-shallow-equal' => array( 'wp-polyfill' ),
427
 
                'keycodes' => array( 'lodash', 'wp-polyfill', 'wp-i18n' ),
428
 
                'list-reusable-blocks' => array(
 
422
                'hooks'                              => array( 'wp-polyfill' ),
 
423
                'html-entities'                      => array( 'wp-polyfill' ),
 
424
                'i18n'                               => array( 'wp-polyfill' ),
 
425
                'is-shallow-equal'                   => array( 'wp-polyfill' ),
 
426
                'keycodes'                           => array( 'lodash', 'wp-polyfill', 'wp-i18n' ),
 
427
                'list-reusable-blocks'               => array(
429
428
                        'lodash',
430
429
                        'wp-api-fetch',
431
430
                        'wp-components',
434
433
                        'wp-i18n',
435
434
                        'wp-polyfill',
436
435
                ),
437
 
                'notices' => array(
 
436
                'notices'                            => array(
438
437
                        'lodash',
439
438
                        'wp-a11y',
440
439
                        'wp-data',
441
440
                        'wp-polyfill',
442
441
                ),
443
 
                'nux' => array(
 
442
                'nux'                                => array(
444
443
                        'wp-element',
445
444
                        'lodash',
446
445
                        'wp-components',
450
449
                        'wp-polyfill',
451
450
                        'lodash',
452
451
                ),
453
 
                'plugins' => array( 'lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill' ),
454
 
                'redux-routine' => array( 'wp-polyfill' ),
455
 
                'rich-text' => array(
 
452
                'plugins'                            => array( 'lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill' ),
 
453
                'redux-routine'                      => array( 'wp-polyfill' ),
 
454
                'rich-text'                          => array(
456
455
                        'lodash',
457
456
                        'wp-data',
458
457
                        'wp-escape-html',
459
458
                        'wp-polyfill',
460
459
                ),
461
 
                'shortcode' => array( 'wp-polyfill', 'lodash' ),
462
 
                'token-list' => array( 'lodash', 'wp-polyfill' ),
463
 
                'url' => array( 'wp-polyfill' ),
464
 
                'viewport' => array( 'wp-polyfill', 'wp-element', 'wp-data', 'wp-compose', 'lodash' ),
465
 
                'wordcount' => array( 'wp-polyfill' ),
 
460
                'shortcode'                          => array( 'wp-polyfill', 'lodash' ),
 
461
                'token-list'                         => array( 'lodash', 'wp-polyfill' ),
 
462
                'url'                                => array( 'wp-polyfill' ),
 
463
                'viewport'                           => array( 'wp-polyfill', 'wp-element', 'wp-data', 'wp-compose', 'lodash' ),
 
464
                'wordcount'                          => array( 'wp-polyfill' ),
466
465
        );
467
466
 
468
467
        $package_translations = array(
469
 
                'api-fetch' => 'default',
470
 
                'blocks' => 'default',
471
 
                'block-library' => 'default',
472
 
                'components' => 'default',
473
 
                'edit-post' => 'default',
474
 
                'editor' => 'default',
475
 
                'format-library' => 'default',
476
 
                'keycodes' => 'default',
477
 
                'list-reusable-blocks' => 'default',
478
 
                'nux' => 'default',
 
468
                'api-fetch',
 
469
                'blocks',
 
470
                'block-library',
 
471
                'components',
 
472
                'edit-post',
 
473
                'editor',
 
474
                'format-library',
 
475
                'keycodes',
 
476
                'list-reusable-blocks',
 
477
                'nux',
479
478
        );
480
479
 
481
480
        foreach ( $packages_dependencies as $package => $dependencies ) {
485
484
 
486
485
                $scripts->add( $handle, $path, $dependencies, $version, 1 );
487
486
 
488
 
                if ( isset( $package_translations[ $package ] ) ) {
489
 
                        $scripts->set_translations( $handle, $package_translations[ $package ] );
 
487
                if ( in_array( $package, $package_translations, true ) ) {
 
488
                        $scripts->set_translations( $handle );
490
489
                }
491
490
        }
492
491
}
529
528
                                '       wp.data',
530
529
                                '               .use( wp.data.plugins.persistence, { storageKey: storageKey } )',
531
530
                                '               .use( wp.data.plugins.controls );',
532
 
                                '} )()',
 
531
                                '} )();',
533
532
                        )
534
533
                )
535
534
        );
675
674
        $external_plugins = apply_filters( 'mce_external_plugins', array(), 'classic-block' );
676
675
 
677
676
        $tinymce_settings = array(
678
 
                'plugins'  => implode( ',', $tinymce_plugins ),
679
 
                'toolbar1' => implode( ',', $toolbar1 ),
680
 
                'toolbar2' => implode( ',', $toolbar2 ),
681
 
                'toolbar3' => implode( ',', $toolbar3 ),
682
 
                'toolbar4' => implode( ',', $toolbar4 ),
683
 
                'external_plugins' => wp_json_encode( $external_plugins ),
 
677
                'plugins'              => implode( ',', $tinymce_plugins ),
 
678
                'toolbar1'             => implode( ',', $toolbar1 ),
 
679
                'toolbar2'             => implode( ',', $toolbar2 ),
 
680
                'toolbar3'             => implode( ',', $toolbar3 ),
 
681
                'toolbar4'             => implode( ',', $toolbar4 ),
 
682
                'external_plugins'     => wp_json_encode( $external_plugins ),
684
683
                'classic_block_editor' => true,
685
684
        );
686
685
 
700
699
        $init_obj = '';
701
700
        foreach ( $tinymce_settings as $key => $value ) {
702
701
                if ( is_bool( $value ) ) {
703
 
                        $val = $value ? 'true' : 'false';
 
702
                        $val       = $value ? 'true' : 'false';
704
703
                        $init_obj .= $key . ':' . $val . ',';
705
704
                        continue;
706
705
                } elseif ( ! empty( $value ) && is_string( $value ) && (
764
763
                if ( ! defined( 'SCRIPT_DEBUG' ) ) {
765
764
                        define( 'SCRIPT_DEBUG', $develop_src );
766
765
                }
767
 
                $suffix = SCRIPT_DEBUG ? '' : '.min';
 
766
                $suffix     = SCRIPT_DEBUG ? '' : '.min';
768
767
                $dev_suffix = $develop_src ? '' : '.min';
769
768
 
770
 
                $suffixes = array( 'suffix' => $suffix, 'dev_suffix' => $dev_suffix );
 
769
                $suffixes = array(
 
770
                        'suffix'     => $suffix,
 
771
                        'dev_suffix' => $dev_suffix,
 
772
                );
771
773
        }
772
774
 
773
775
        if ( $type === 'dev' ) {
789
791
 * @param WP_Scripts $scripts WP_Scripts object.
790
792
 */
791
793
function wp_default_scripts( &$scripts ) {
792
 
        $suffix = wp_scripts_get_suffix();
 
794
        $suffix     = wp_scripts_get_suffix();
793
795
        $dev_suffix = wp_scripts_get_suffix( 'dev' );
794
796
 
795
797
        if ( ! $guessurl = site_url() ) {
796
798
                $guessed_url = true;
797
 
                $guessurl = wp_guess_url();
 
799
                $guessurl    = wp_guess_url();
798
800
        }
799
801
 
800
 
        $scripts->base_url = $guessurl;
801
 
        $scripts->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';
 
802
        $scripts->base_url        = $guessurl;
 
803
        $scripts->content_url     = defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL : '';
802
804
        $scripts->default_version = get_bloginfo( 'version' );
803
 
        $scripts->default_dirs = array('/wp-admin/js/', '/wp-includes/js/');
804
 
 
 
805
        $scripts->default_dirs    = array( '/wp-admin/js/', '/wp-includes/js/' );
805
806
 
806
807
        $scripts->add( 'utils', "/wp-includes/js/utils$suffix.js" );
807
 
        did_action( 'init' ) && $scripts->localize( 'utils', 'userSettings', array(
808
 
                'url' => (string) SITECOOKIEPATH,
809
 
                'uid' => (string) get_current_user_id(),
810
 
                'time' => (string) time(),
811
 
                'secure' => (string) ( 'https' === parse_url( site_url(), PHP_URL_SCHEME ) ),
812
 
        ) );
 
808
        did_action( 'init' ) && $scripts->localize(
 
809
                'utils',
 
810
                'userSettings',
 
811
                array(
 
812
                        'url'    => (string) SITECOOKIEPATH,
 
813
                        'uid'    => (string) get_current_user_id(),
 
814
                        'time'   => (string) time(),
 
815
                        'secure' => (string) ( 'https' === parse_url( site_url(), PHP_URL_SCHEME ) ),
 
816
                )
 
817
        );
813
818
 
814
 
        $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 );
815
 
        did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array(
816
 
                'warnDelete'   => __( "You are about to permanently delete these items from your site.\nThis action cannot be undone.\n 'Cancel' to stop, 'OK' to delete." ),
817
 
                'dismiss'      => __( 'Dismiss this notice.' ),
818
 
                'collapseMenu' => __( 'Collapse Main menu' ),
819
 
                'expandMenu'   => __( 'Expand Main menu' ),
820
 
        ) );
 
819
        $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array( 'jquery', 'hoverIntent', 'utils' ), false, 1 );
 
820
        did_action( 'init' ) && $scripts->localize(
 
821
                'common',
 
822
                'commonL10n',
 
823
                array(
 
824
                        'warnDelete'   => __( "You are about to permanently delete these items from your site.\nThis action cannot be undone.\n 'Cancel' to stop, 'OK' to delete." ),
 
825
                        'dismiss'      => __( 'Dismiss this notice.' ),
 
826
                        'collapseMenu' => __( 'Collapse Main menu' ),
 
827
                        'expandMenu'   => __( 'Expand Main menu' ),
 
828
                )
 
829
        );
821
830
 
822
831
        $scripts->add( 'wp-a11y', "/wp-includes/js/wp-a11y$suffix.js", array( 'jquery' ), false, 1 );
823
832
 
824
833
        $scripts->add( 'sack', "/wp-includes/js/tw-sack$suffix.js", array(), '1.6.1', 1 );
825
834
 
826
835
        $scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", array(), false, 1 );
827
 
        did_action( 'init' ) && $scripts->localize( 'quicktags', 'quicktagsL10n', array(
828
 
                'closeAllOpenTags'      => __( 'Close all open tags' ),
829
 
                'closeTags'             => __( 'close tags' ),
830
 
                'enterURL'              => __( 'Enter the URL' ),
831
 
                'enterImageURL'         => __( 'Enter the URL of the image' ),
832
 
                'enterImageDescription' => __( 'Enter a description of the image' ),
833
 
                'textdirection'         => __( 'text direction' ),
834
 
                'toggleTextdirection'   => __( 'Toggle Editor Text Direction' ),
835
 
                'dfw'                   => __( 'Distraction-free writing mode' ),
836
 
                'strong'          => __( 'Bold' ),
837
 
                'strongClose'     => __( 'Close bold tag' ),
838
 
                'em'              => __( 'Italic' ),
839
 
                'emClose'         => __( 'Close italic tag' ),
840
 
                'link'            => __( 'Insert link' ),
841
 
                'blockquote'      => __( 'Blockquote' ),
842
 
                'blockquoteClose' => __( 'Close blockquote tag' ),
843
 
                'del'             => __( 'Deleted text (strikethrough)' ),
844
 
                'delClose'        => __( 'Close deleted text tag' ),
845
 
                'ins'             => __( 'Inserted text' ),
846
 
                'insClose'        => __( 'Close inserted text tag' ),
847
 
                'image'           => __( 'Insert image' ),
848
 
                'ul'              => __( 'Bulleted list' ),
849
 
                'ulClose'         => __( 'Close bulleted list tag' ),
850
 
                'ol'              => __( 'Numbered list' ),
851
 
                'olClose'         => __( 'Close numbered list tag' ),
852
 
                'li'              => __( 'List item' ),
853
 
                'liClose'         => __( 'Close list item tag' ),
854
 
                'code'            => __( 'Code' ),
855
 
                'codeClose'       => __( 'Close code tag' ),
856
 
                'more'            => __( 'Insert Read More tag' ),
857
 
        ) );
858
 
 
859
 
        $scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array('prototype'), '3517m' );
860
 
 
861
 
        $scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), false, 1 );
 
836
        did_action( 'init' ) && $scripts->localize(
 
837
                'quicktags',
 
838
                'quicktagsL10n',
 
839
                array(
 
840
                        'closeAllOpenTags'      => __( 'Close all open tags' ),
 
841
                        'closeTags'             => __( 'close tags' ),
 
842
                        'enterURL'              => __( 'Enter the URL' ),
 
843
                        'enterImageURL'         => __( 'Enter the URL of the image' ),
 
844
                        'enterImageDescription' => __( 'Enter a description of the image' ),
 
845
                        'textdirection'         => __( 'text direction' ),
 
846
                        'toggleTextdirection'   => __( 'Toggle Editor Text Direction' ),
 
847
                        'dfw'                   => __( 'Distraction-free writing mode' ),
 
848
                        'strong'                => __( 'Bold' ),
 
849
                        'strongClose'           => __( 'Close bold tag' ),
 
850
                        'em'                    => __( 'Italic' ),
 
851
                        'emClose'               => __( 'Close italic tag' ),
 
852
                        'link'                  => __( 'Insert link' ),
 
853
                        'blockquote'            => __( 'Blockquote' ),
 
854
                        'blockquoteClose'       => __( 'Close blockquote tag' ),
 
855
                        'del'                   => __( 'Deleted text (strikethrough)' ),
 
856
                        'delClose'              => __( 'Close deleted text tag' ),
 
857
                        'ins'                   => __( 'Inserted text' ),
 
858
                        'insClose'              => __( 'Close inserted text tag' ),
 
859
                        'image'                 => __( 'Insert image' ),
 
860
                        'ul'                    => __( 'Bulleted list' ),
 
861
                        'ulClose'               => __( 'Close bulleted list tag' ),
 
862
                        'ol'                    => __( 'Numbered list' ),
 
863
                        'olClose'               => __( 'Close numbered list tag' ),
 
864
                        'li'                    => __( 'List item' ),
 
865
                        'liClose'               => __( 'Close list item tag' ),
 
866
                        'code'                  => __( 'Code' ),
 
867
                        'codeClose'             => __( 'Close code tag' ),
 
868
                        'more'                  => __( 'Insert Read More tag' ),
 
869
                )
 
870
        );
 
871
 
 
872
        $scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array( 'prototype' ), '3517m' );
 
873
 
 
874
        $scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array( 'utils', 'jquery' ), false, 1 );
862
875
 
863
876
        // Back-compat for old DFW. To-do: remove at the end of 2016.
864
877
        $scripts->add( 'wp-fullscreen-stub', "/wp-admin/js/wp-fullscreen-stub$suffix.js", array(), false, 1 );
865
878
 
866
 
        $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), false, 1 );
867
 
        did_action( 'init' ) && $scripts->localize( 'wp-ajax-response', 'wpAjax', array(
868
 
                'noPerm' => __('Sorry, you are not allowed to do that.'),
869
 
                'broken' => __('Something went wrong.')
870
 
        ) );
 
879
        $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array( 'jquery' ), false, 1 );
 
880
        did_action( 'init' ) && $scripts->localize(
 
881
                'wp-ajax-response',
 
882
                'wpAjax',
 
883
                array(
 
884
                        'noPerm' => __( 'Sorry, you are not allowed to do that.' ),
 
885
                        'broken' => __( 'Something went wrong.' ),
 
886
                )
 
887
        );
871
888
 
872
889
        $scripts->add( 'wp-api-request', "/wp-includes/js/api-request$suffix.js", array( 'jquery' ), false, 1 );
873
890
        // `wpApiSettings` is also used by `wp-api`, which depends on this script.
874
 
        did_action( 'init' ) && $scripts->localize( 'wp-api-request', 'wpApiSettings', array(
875
 
                'root'          => esc_url_raw( get_rest_url() ),
876
 
                'nonce'         => ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'wp_rest' ),
877
 
                'versionString' => 'wp/v2/',
878
 
        ) );
 
891
        did_action( 'init' ) && $scripts->localize(
 
892
                'wp-api-request',
 
893
                'wpApiSettings',
 
894
                array(
 
895
                        'root'          => esc_url_raw( get_rest_url() ),
 
896
                        'nonce'         => ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'wp_rest' ),
 
897
                        'versionString' => 'wp/v2/',
 
898
                )
 
899
        );
879
900
 
880
901
        $scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), '20111129a', 1 );
881
 
        did_action( 'init' ) && $scripts->localize( 'wp-pointer', 'wpPointerL10n', array(
882
 
                'dismiss' => __('Dismiss'),
883
 
        ) );
 
902
        did_action( 'init' ) && $scripts->localize(
 
903
                'wp-pointer',
 
904
                'wpPointerL10n',
 
905
                array(
 
906
                        'dismiss' => __( 'Dismiss' ),
 
907
                )
 
908
        );
884
909
 
885
 
        $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('heartbeat'), false, 1 );
 
910
        $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array( 'heartbeat' ), false, 1 );
886
911
 
887
912
        $scripts->add( 'heartbeat', "/wp-includes/js/heartbeat$suffix.js", array( 'jquery', 'wp-hooks' ), false, 1 );
888
 
        did_action( 'init' ) && $scripts->localize( 'heartbeat', 'heartbeatSettings',
 
913
        did_action( 'init' ) && $scripts->localize(
 
914
                'heartbeat',
 
915
                'heartbeatSettings',
889
916
                /**
890
917
                 * Filters the Heartbeat settings.
891
918
                 *
896
923
                apply_filters( 'heartbeat_settings', array() )
897
924
        );
898
925
 
899
 
        $scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array('heartbeat'), false, 1 );
900
 
        did_action( 'init' ) && $scripts->localize( 'wp-auth-check', 'authcheckL10n', array(
901
 
                'beforeunload' => __('Your session has expired. You can log in again from this page or go to the login page.'),
 
926
        $scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array( 'heartbeat' ), false, 1 );
 
927
        did_action( 'init' ) && $scripts->localize(
 
928
                'wp-auth-check',
 
929
                'authcheckL10n',
 
930
                array(
 
931
                        'beforeunload' => __( 'Your session has expired. You can log in again from this page or go to the login page.' ),
902
932
 
903
 
                /**
904
 
                 * Filters the authentication check interval.
905
 
                 *
906
 
                 * @since 3.6.0
907
 
                 *
908
 
                 * @param int $interval The interval in which to check a user's authentication.
909
 
                 *                      Default 3 minutes in seconds, or 180.
910
 
                 */
911
 
                'interval' => apply_filters( 'wp_auth_check_interval', 3 * MINUTE_IN_SECONDS ),
912
 
        ) );
 
933
                        /**
 
934
                         * Filters the authentication check interval.
 
935
                         *
 
936
                         * @since 3.6.0
 
937
                         *
 
938
                         * @param int $interval The interval in which to check a user's authentication.
 
939
                         *                      Default 3 minutes in seconds, or 180.
 
940
                         */
 
941
                        'interval'     => apply_filters( 'wp_auth_check_interval', 3 * MINUTE_IN_SECONDS ),
 
942
                )
 
943
        );
913
944
 
914
945
        $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array( 'wp-ajax-response', 'jquery-color' ), false, 1 );
915
946
 
916
947
        // WordPress no longer uses or bundles Prototype or script.aculo.us. These are now pulled from an external source.
917
 
        $scripts->add( 'prototype', 'https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js', array(), '1.7.1');
918
 
        $scripts->add( 'scriptaculous-root', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js', array('prototype'), '1.9.0');
919
 
        $scripts->add( 'scriptaculous-builder', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js', array('scriptaculous-root'), '1.9.0');
920
 
        $scripts->add( 'scriptaculous-dragdrop', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.9.0');
921
 
        $scripts->add( 'scriptaculous-effects', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js', array('scriptaculous-root'), '1.9.0');
922
 
        $scripts->add( 'scriptaculous-slider', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js', array('scriptaculous-effects'), '1.9.0');
 
948
        $scripts->add( 'prototype', 'https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js', array(), '1.7.1' );
 
949
        $scripts->add( 'scriptaculous-root', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js', array( 'prototype' ), '1.9.0' );
 
950
        $scripts->add( 'scriptaculous-builder', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js', array( 'scriptaculous-root' ), '1.9.0' );
 
951
        $scripts->add( 'scriptaculous-dragdrop', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js', array( 'scriptaculous-builder', 'scriptaculous-effects' ), '1.9.0' );
 
952
        $scripts->add( 'scriptaculous-effects', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js', array( 'scriptaculous-root' ), '1.9.0' );
 
953
        $scripts->add( 'scriptaculous-slider', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js', array( 'scriptaculous-effects' ), '1.9.0' );
923
954
        $scripts->add( 'scriptaculous-sound', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/sound.js', array( 'scriptaculous-root' ), '1.9.0' );
924
 
        $scripts->add( 'scriptaculous-controls', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js', array('scriptaculous-root'), '1.9.0');
925
 
        $scripts->add( 'scriptaculous', false, array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls') );
 
955
        $scripts->add( 'scriptaculous-controls', 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js', array( 'scriptaculous-root' ), '1.9.0' );
 
956
        $scripts->add( 'scriptaculous', false, array( 'scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls' ) );
926
957
 
927
958
        // not used in core, replaced by Jcrop.js
928
 
        $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop') );
 
959
        $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array( 'scriptaculous-dragdrop' ) );
929
960
 
930
961
        // jQuery
931
962
        $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.12.4' );
933
964
        $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.4.1' );
934
965
 
935
966
        // full jQuery UI
936
 
        $scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array('jquery'), '1.11.4', 1 );
937
 
        $scripts->add( 'jquery-effects-core', "/wp-includes/js/jquery/ui/effect$dev_suffix.js", array('jquery'), '1.11.4', 1 );
938
 
 
939
 
        $scripts->add( 'jquery-effects-blind', "/wp-includes/js/jquery/ui/effect-blind$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
940
 
        $scripts->add( 'jquery-effects-bounce', "/wp-includes/js/jquery/ui/effect-bounce$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
941
 
        $scripts->add( 'jquery-effects-clip', "/wp-includes/js/jquery/ui/effect-clip$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
942
 
        $scripts->add( 'jquery-effects-drop', "/wp-includes/js/jquery/ui/effect-drop$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
943
 
        $scripts->add( 'jquery-effects-explode', "/wp-includes/js/jquery/ui/effect-explode$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
944
 
        $scripts->add( 'jquery-effects-fade', "/wp-includes/js/jquery/ui/effect-fade$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
945
 
        $scripts->add( 'jquery-effects-fold', "/wp-includes/js/jquery/ui/effect-fold$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
946
 
        $scripts->add( 'jquery-effects-highlight', "/wp-includes/js/jquery/ui/effect-highlight$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
947
 
        $scripts->add( 'jquery-effects-puff', "/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js", array('jquery-effects-core', 'jquery-effects-scale'), '1.11.4', 1 );
948
 
        $scripts->add( 'jquery-effects-pulsate', "/wp-includes/js/jquery/ui/effect-pulsate$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
949
 
        $scripts->add( 'jquery-effects-scale', "/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js", array('jquery-effects-core', 'jquery-effects-size'), '1.11.4', 1 );
950
 
        $scripts->add( 'jquery-effects-shake', "/wp-includes/js/jquery/ui/effect-shake$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
951
 
        $scripts->add( 'jquery-effects-size', "/wp-includes/js/jquery/ui/effect-size$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
952
 
        $scripts->add( 'jquery-effects-slide', "/wp-includes/js/jquery/ui/effect-slide$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
953
 
        $scripts->add( 'jquery-effects-transfer', "/wp-includes/js/jquery/ui/effect-transfer$dev_suffix.js", array('jquery-effects-core'), '1.11.4', 1 );
954
 
 
955
 
        $scripts->add( 'jquery-ui-accordion', "/wp-includes/js/jquery/ui/accordion$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 );
 
967
        $scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 );
 
968
        $scripts->add( 'jquery-effects-core', "/wp-includes/js/jquery/ui/effect$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 );
 
969
 
 
970
        $scripts->add( 'jquery-effects-blind', "/wp-includes/js/jquery/ui/effect-blind$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
971
        $scripts->add( 'jquery-effects-bounce', "/wp-includes/js/jquery/ui/effect-bounce$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
972
        $scripts->add( 'jquery-effects-clip', "/wp-includes/js/jquery/ui/effect-clip$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
973
        $scripts->add( 'jquery-effects-drop', "/wp-includes/js/jquery/ui/effect-drop$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
974
        $scripts->add( 'jquery-effects-explode', "/wp-includes/js/jquery/ui/effect-explode$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
975
        $scripts->add( 'jquery-effects-fade', "/wp-includes/js/jquery/ui/effect-fade$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
976
        $scripts->add( 'jquery-effects-fold', "/wp-includes/js/jquery/ui/effect-fold$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
977
        $scripts->add( 'jquery-effects-highlight', "/wp-includes/js/jquery/ui/effect-highlight$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
978
        $scripts->add( 'jquery-effects-puff', "/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js", array( 'jquery-effects-core', 'jquery-effects-scale' ), '1.11.4', 1 );
 
979
        $scripts->add( 'jquery-effects-pulsate', "/wp-includes/js/jquery/ui/effect-pulsate$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
980
        $scripts->add( 'jquery-effects-scale', "/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js", array( 'jquery-effects-core', 'jquery-effects-size' ), '1.11.4', 1 );
 
981
        $scripts->add( 'jquery-effects-shake', "/wp-includes/js/jquery/ui/effect-shake$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
982
        $scripts->add( 'jquery-effects-size', "/wp-includes/js/jquery/ui/effect-size$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
983
        $scripts->add( 'jquery-effects-slide', "/wp-includes/js/jquery/ui/effect-slide$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
984
        $scripts->add( 'jquery-effects-transfer', "/wp-includes/js/jquery/ui/effect-transfer$dev_suffix.js", array( 'jquery-effects-core' ), '1.11.4', 1 );
 
985
 
 
986
        $scripts->add( 'jquery-ui-accordion', "/wp-includes/js/jquery/ui/accordion$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );
956
987
        $scripts->add( 'jquery-ui-autocomplete', "/wp-includes/js/jquery/ui/autocomplete$dev_suffix.js", array( 'jquery-ui-menu', 'wp-a11y' ), '1.11.4', 1 );
957
 
        $scripts->add( 'jquery-ui-button', "/wp-includes/js/jquery/ui/button$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 );
958
 
        $scripts->add( 'jquery-ui-datepicker', "/wp-includes/js/jquery/ui/datepicker$dev_suffix.js", array('jquery-ui-core'), '1.11.4', 1 );
959
 
        $scripts->add( 'jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog$dev_suffix.js", array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.11.4', 1 );
960
 
        $scripts->add( 'jquery-ui-draggable', "/wp-includes/js/jquery/ui/draggable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 );
961
 
        $scripts->add( 'jquery-ui-droppable', "/wp-includes/js/jquery/ui/droppable$dev_suffix.js", array('jquery-ui-draggable'), '1.11.4', 1 );
 
988
        $scripts->add( 'jquery-ui-button', "/wp-includes/js/jquery/ui/button$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );
 
989
        $scripts->add( 'jquery-ui-datepicker', "/wp-includes/js/jquery/ui/datepicker$dev_suffix.js", array( 'jquery-ui-core' ), '1.11.4', 1 );
 
990
        $scripts->add( 'jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog$dev_suffix.js", array( 'jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position' ), '1.11.4', 1 );
 
991
        $scripts->add( 'jquery-ui-draggable', "/wp-includes/js/jquery/ui/draggable$dev_suffix.js", array( 'jquery-ui-mouse' ), '1.11.4', 1 );
 
992
        $scripts->add( 'jquery-ui-droppable', "/wp-includes/js/jquery/ui/droppable$dev_suffix.js", array( 'jquery-ui-draggable' ), '1.11.4', 1 );
962
993
        $scripts->add( 'jquery-ui-menu', "/wp-includes/js/jquery/ui/menu$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.4', 1 );
963
994
        $scripts->add( 'jquery-ui-mouse', "/wp-includes/js/jquery/ui/mouse$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );
964
 
        $scripts->add( 'jquery-ui-position', "/wp-includes/js/jquery/ui/position$dev_suffix.js", array('jquery'), '1.11.4', 1 );
965
 
        $scripts->add( 'jquery-ui-progressbar', "/wp-includes/js/jquery/ui/progressbar$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 );
966
 
        $scripts->add( 'jquery-ui-resizable', "/wp-includes/js/jquery/ui/resizable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 );
967
 
        $scripts->add( 'jquery-ui-selectable', "/wp-includes/js/jquery/ui/selectable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 );
968
 
        $scripts->add( 'jquery-ui-selectmenu', "/wp-includes/js/jquery/ui/selectmenu$dev_suffix.js", array('jquery-ui-menu'), '1.11.4', 1 );
969
 
        $scripts->add( 'jquery-ui-slider', "/wp-includes/js/jquery/ui/slider$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 );
970
 
        $scripts->add( 'jquery-ui-sortable', "/wp-includes/js/jquery/ui/sortable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.4', 1 );
 
995
        $scripts->add( 'jquery-ui-position', "/wp-includes/js/jquery/ui/position$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 );
 
996
        $scripts->add( 'jquery-ui-progressbar', "/wp-includes/js/jquery/ui/progressbar$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );
 
997
        $scripts->add( 'jquery-ui-resizable', "/wp-includes/js/jquery/ui/resizable$dev_suffix.js", array( 'jquery-ui-mouse' ), '1.11.4', 1 );
 
998
        $scripts->add( 'jquery-ui-selectable', "/wp-includes/js/jquery/ui/selectable$dev_suffix.js", array( 'jquery-ui-mouse' ), '1.11.4', 1 );
 
999
        $scripts->add( 'jquery-ui-selectmenu', "/wp-includes/js/jquery/ui/selectmenu$dev_suffix.js", array( 'jquery-ui-menu' ), '1.11.4', 1 );
 
1000
        $scripts->add( 'jquery-ui-slider', "/wp-includes/js/jquery/ui/slider$dev_suffix.js", array( 'jquery-ui-mouse' ), '1.11.4', 1 );
 
1001
        $scripts->add( 'jquery-ui-sortable', "/wp-includes/js/jquery/ui/sortable$dev_suffix.js", array( 'jquery-ui-mouse' ), '1.11.4', 1 );
971
1002
        $scripts->add( 'jquery-ui-spinner', "/wp-includes/js/jquery/ui/spinner$dev_suffix.js", array( 'jquery-ui-button' ), '1.11.4', 1 );
972
 
        $scripts->add( 'jquery-ui-tabs', "/wp-includes/js/jquery/ui/tabs$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.4', 1 );
 
1003
        $scripts->add( 'jquery-ui-tabs', "/wp-includes/js/jquery/ui/tabs$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.4', 1 );
973
1004
        $scripts->add( 'jquery-ui-tooltip', "/wp-includes/js/jquery/ui/tooltip$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.4', 1 );
974
 
        $scripts->add( 'jquery-ui-widget', "/wp-includes/js/jquery/ui/widget$dev_suffix.js", array('jquery'), '1.11.4', 1 );
 
1005
        $scripts->add( 'jquery-ui-widget', "/wp-includes/js/jquery/ui/widget$dev_suffix.js", array( 'jquery' ), '1.11.4', 1 );
975
1006
 
976
1007
        // Strings for 'jquery-ui-autocomplete' live region messages
977
 
        did_action( 'init' ) && $scripts->localize( 'jquery-ui-autocomplete', 'uiAutocompleteL10n', array(
978
 
                'noResults' => __( 'No results found.' ),
979
 
                /* translators: Number of results found when using jQuery UI Autocomplete */
980
 
                'oneResult' => __( '1 result found. Use up and down arrow keys to navigate.' ),
981
 
                /* translators: %d: Number of results found when using jQuery UI Autocomplete */
982
 
                'manyResults' => __( '%d results found. Use up and down arrow keys to navigate.' ),
983
 
                'itemSelected' => __( 'Item selected.' ),
984
 
        ) );
 
1008
        did_action( 'init' ) && $scripts->localize(
 
1009
                'jquery-ui-autocomplete',
 
1010
                'uiAutocompleteL10n',
 
1011
                array(
 
1012
                        'noResults'    => __( 'No results found.' ),
 
1013
                        /* translators: Number of results found when using jQuery UI Autocomplete */
 
1014
                        'oneResult'    => __( '1 result found. Use up and down arrow keys to navigate.' ),
 
1015
                        /* translators: %d: Number of results found when using jQuery UI Autocomplete */
 
1016
                        'manyResults'  => __( '%d results found. Use up and down arrow keys to navigate.' ),
 
1017
                        'itemSelected' => __( 'Item selected.' ),
 
1018
                )
 
1019
        );
985
1020
 
986
1021
        // deprecated, not used in core, most functionality is included in jQuery 1.3
987
 
        $scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '4.2.1', 1 );
 
1022
        $scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array( 'jquery' ), '4.2.1', 1 );
988
1023
 
989
1024
        // jQuery plugins
990
 
        $scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color.min.js", array('jquery'), '2.1.1', 1 );
991
 
        $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20m', 1 );
992
 
        $scripts->add( 'jquery-query', "/wp-includes/js/jquery/jquery.query.js", array('jquery'), '2.1.7', 1 );
993
 
        $scripts->add( 'jquery-serialize-object', "/wp-includes/js/jquery/jquery.serialize-object.js", array('jquery'), '0.2', 1 );
994
 
        $scripts->add( 'jquery-hotkeys', "/wp-includes/js/jquery/jquery.hotkeys$suffix.js", array('jquery'), '0.0.2m', 1 );
995
 
        $scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), false, 1 );
996
 
        $scripts->add( 'jquery-touch-punch', "/wp-includes/js/jquery/jquery.ui.touch-punch.js", array('jquery-ui-widget', 'jquery-ui-mouse'), '0.2.2', 1 );
 
1025
        $scripts->add( 'jquery-color', '/wp-includes/js/jquery/jquery.color.min.js', array( 'jquery' ), '2.1.1', 1 );
 
1026
        $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array( 'jquery' ), '20m', 1 );
 
1027
        $scripts->add( 'jquery-query', '/wp-includes/js/jquery/jquery.query.js', array( 'jquery' ), '2.1.7', 1 );
 
1028
        $scripts->add( 'jquery-serialize-object', '/wp-includes/js/jquery/jquery.serialize-object.js', array( 'jquery' ), '0.2', 1 );
 
1029
        $scripts->add( 'jquery-hotkeys', "/wp-includes/js/jquery/jquery.hotkeys$suffix.js", array( 'jquery' ), '0.0.2m', 1 );
 
1030
        $scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array( 'jquery', 'jquery-hotkeys' ), false, 1 );
 
1031
        $scripts->add( 'jquery-touch-punch', '/wp-includes/js/jquery/jquery.ui.touch-punch.js', array( 'jquery-ui-widget', 'jquery-ui-mouse' ), '0.2.2', 1 );
997
1032
 
998
1033
        // Not used any more, registered for backwards compatibility.
999
 
        $scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20110113', 1 );
 
1034
        $scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array( 'jquery' ), '1.1-20110113', 1 );
1000
1035
 
1001
1036
        // Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv.
1002
1037
        // It sets jQuery as a dependency, as the theme may have been implicitly loading it this way.
1003
 
        $scripts->add( 'imagesloaded', "/wp-includes/js/imagesloaded.min.js", array(), '3.2.0', 1 );
1004
 
        $scripts->add( 'masonry', "/wp-includes/js/masonry.min.js", array( 'imagesloaded' ), '3.3.2', 1 );
 
1038
        $scripts->add( 'imagesloaded', '/wp-includes/js/imagesloaded.min.js', array(), '3.2.0', 1 );
 
1039
        $scripts->add( 'masonry', '/wp-includes/js/masonry.min.js', array( 'imagesloaded' ), '3.3.2', 1 );
1005
1040
        $scripts->add( 'jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$dev_suffix.js", array( 'jquery', 'masonry' ), '3.1.2b', 1 );
1006
1041
 
1007
 
        $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20121105', 1 );
1008
 
        did_action( 'init' ) && $scripts->localize( 'thickbox', 'thickboxL10n', array(
1009
 
                'next' => __('Next >'),
1010
 
                'prev' => __('< Prev'),
1011
 
                'image' => __('Image'),
1012
 
                'of' => __('of'),
1013
 
                'close' => __('Close'),
1014
 
                'noiframes' => __('This feature requires inline frames. You have iframes disabled or your browser does not support them.'),
1015
 
                'loadingAnimation' => includes_url('js/thickbox/loadingAnimation.gif'),
1016
 
        ) );
1017
 
 
1018
 
        $scripts->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop.min.js", array('jquery'), '0.9.12');
1019
 
 
1020
 
        $scripts->add( 'swfobject', "/wp-includes/js/swfobject.js", array(), '2.2-20120417');
 
1042
        $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array( 'jquery' ), '3.1-20121105', 1 );
 
1043
        did_action( 'init' ) && $scripts->localize(
 
1044
                'thickbox',
 
1045
                'thickboxL10n',
 
1046
                array(
 
1047
                        'next'             => __( 'Next >' ),
 
1048
                        'prev'             => __( '< Prev' ),
 
1049
                        'image'            => __( 'Image' ),
 
1050
                        'of'               => __( 'of' ),
 
1051
                        'close'            => __( 'Close' ),
 
1052
                        'noiframes'        => __( 'This feature requires inline frames. You have iframes disabled or your browser does not support them.' ),
 
1053
                        'loadingAnimation' => includes_url( 'js/thickbox/loadingAnimation.gif' ),
 
1054
                )
 
1055
        );
 
1056
 
 
1057
        $scripts->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.min.js', array( 'jquery' ), '0.9.12' );
 
1058
 
 
1059
        $scripts->add( 'swfobject', '/wp-includes/js/swfobject.js', array(), '2.2-20120417' );
1021
1060
 
1022
1061
        // Error messages for Plupload.
1023
1062
        $uploader_l10n = array(
1024
 
                'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
1025
 
                'file_exceeds_size_limit' => __('%s exceeds the maximum upload size for this site.'),
1026
 
                'zero_byte_file' => __('This file is empty. Please try another.'),
1027
 
                'invalid_filetype' => __('Sorry, this file type is not permitted for security reasons.'),
1028
 
                'not_an_image' => __('This file is not an image. Please try another.'),
1029
 
                'image_memory_exceeded' => __('Memory exceeded. Please try another smaller file.'),
1030
 
                'image_dimensions_exceeded' => __('This is larger than the maximum size. Please try another.'),
1031
 
                'default_error' => __('An error occurred in the upload. Please try again later.'),
1032
 
                'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'),
1033
 
                'upload_limit_exceeded' => __('You may only upload 1 file.'),
1034
 
                'http_error' => __('HTTP error.'),
1035
 
                'upload_failed' => __('Upload failed.'),
 
1063
                'queue_limit_exceeded'      => __( 'You have attempted to queue too many files.' ),
 
1064
                'file_exceeds_size_limit'   => __( '%s exceeds the maximum upload size for this site.' ),
 
1065
                'zero_byte_file'            => __( 'This file is empty. Please try another.' ),
 
1066
                'invalid_filetype'          => __( 'Sorry, this file type is not permitted for security reasons.' ),
 
1067
                'not_an_image'              => __( 'This file is not an image. Please try another.' ),
 
1068
                'image_memory_exceeded'     => __( 'Memory exceeded. Please try another smaller file.' ),
 
1069
                'image_dimensions_exceeded' => __( 'This is larger than the maximum size. Please try another.' ),
 
1070
                'default_error'             => __( 'An error occurred in the upload. Please try again later.' ),
 
1071
                'missing_upload_url'        => __( 'There was a configuration error. Please contact the server administrator.' ),
 
1072
                'upload_limit_exceeded'     => __( 'You may only upload 1 file.' ),
 
1073
                'http_error'                => __( 'HTTP error.' ),
 
1074
                'upload_failed'             => __( 'Upload failed.' ),
1036
1075
                /* translators: 1: Opening link tag, 2: Closing link tag */
1037
 
                'big_upload_failed' => __('Please try uploading this file with the %1$sbrowser uploader%2$s.'),
1038
 
                'big_upload_queued' => __('%s exceeds the maximum upload size for the multi-file uploader when used in your browser.'),
1039
 
                'io_error' => __('IO error.'),
1040
 
                'security_error' => __('Security error.'),
1041
 
                'file_cancelled' => __('File canceled.'),
1042
 
                'upload_stopped' => __('Upload stopped.'),
1043
 
                'dismiss' => __('Dismiss'),
1044
 
                'crunching' => __('Crunching…'),
1045
 
                'deleted' => __('moved to the trash.'),
1046
 
                'error_uploading' => __('“%s” has failed to upload.')
 
1076
                'big_upload_failed'         => __( 'Please try uploading this file with the %1$sbrowser uploader%2$s.' ),
 
1077
                'big_upload_queued'         => __( '%s exceeds the maximum upload size for the multi-file uploader when used in your browser.' ),
 
1078
                'io_error'                  => __( 'IO error.' ),
 
1079
                'security_error'            => __( 'Security error.' ),
 
1080
                'file_cancelled'            => __( 'File canceled.' ),
 
1081
                'upload_stopped'            => __( 'Upload stopped.' ),
 
1082
                'dismiss'                   => __( 'Dismiss' ),
 
1083
                'crunching'                 => __( 'Crunching…' ),
 
1084
                'deleted'                   => __( 'moved to the trash.' ),
 
1085
                'error_uploading'           => __( '“%s” has failed to upload.' ),
1047
1086
        );
1048
1087
 
1049
1088
        $scripts->add( 'moxiejs', "/wp-includes/js/plupload/moxie$suffix.js", array(), '1.3.5' );
1060
1099
        did_action( 'init' ) && $scripts->localize( 'wp-plupload', 'pluploadL10n', $uploader_l10n );
1061
1100
 
1062
1101
        // keep 'swfupload' for back-compat.
1063
 
        $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113');
 
1102
        $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113' );
1064
1103
        $scripts->add( 'swfupload-all', false, array( 'swfupload' ), '2201' );
1065
 
        $scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20110524');
 
1104
        $scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array( 'swfupload-all', 'jquery' ), '2201-20110524' );
1066
1105
        did_action( 'init' ) && $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n );
1067
1106
 
1068
1107
        $scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js", array(), false, 1 );
1071
1110
        did_action( 'init' ) && $scripts->add_data( 'json2', 'conditional', 'lt IE 8' );
1072
1111
 
1073
1112
        $scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.8.3', 1 );
1074
 
        $scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore','jquery' ), '1.2.3', 1 );
1075
 
 
1076
 
        $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array('underscore', 'jquery'), false, 1 );
1077
 
        did_action( 'init' ) && $scripts->localize( 'wp-util', '_wpUtilSettings', array(
1078
 
                'ajax' => array(
1079
 
                        'url' => admin_url( 'admin-ajax.php', 'relative' ),
1080
 
                ),
1081
 
        ) );
1082
 
 
1083
 
        $scripts->add( 'wp-sanitize', "/wp-includes/js/wp-sanitize$suffix.js", array('jquery'), false, 1 );
1084
 
 
1085
 
        $scripts->add( 'wp-backbone', "/wp-includes/js/wp-backbone$suffix.js", array('backbone', 'wp-util'), false, 1 );
 
1113
        $scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore', 'jquery' ), '1.2.3', 1 );
 
1114
 
 
1115
        $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array( 'underscore', 'jquery' ), false, 1 );
 
1116
        did_action( 'init' ) && $scripts->localize(
 
1117
                'wp-util',
 
1118
                '_wpUtilSettings',
 
1119
                array(
 
1120
                        'ajax' => array(
 
1121
                                'url' => admin_url( 'admin-ajax.php', 'relative' ),
 
1122
                        ),
 
1123
                )
 
1124
        );
 
1125
 
 
1126
        $scripts->add( 'wp-sanitize', "/wp-includes/js/wp-sanitize$suffix.js", array( 'jquery' ), false, 1 );
 
1127
 
 
1128
        $scripts->add( 'wp-backbone', "/wp-includes/js/wp-backbone$suffix.js", array( 'backbone', 'wp-util' ), false, 1 );
1086
1129
 
1087
1130
        $scripts->add( 'revisions', "/wp-admin/js/revisions$suffix.js", array( 'wp-backbone', 'jquery-ui-slider', 'hoverIntent' ), false, 1 );
1088
1131
 
1089
 
        $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), false, 1 );
 
1132
        $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array( 'jquery' ), false, 1 );
1090
1133
 
1091
1134
        $scripts->add( 'mediaelement', false, array( 'jquery', 'mediaelement-core', 'mediaelement-migrate' ), '4.2.6-78496d1' );
1092
1135
        $scripts->add( 'mediaelement-core', "/wp-includes/js/mediaelement/mediaelement-and-player$suffix.js", array(), '4.2.6-78496d1', 1 );
1093
 
        $scripts->add( 'mediaelement-migrate', "/wp-includes/js/mediaelement/mediaelement-migrate$suffix.js", array(), false, 1);
1094
 
 
1095
 
        did_action( 'init' ) && $scripts->add_inline_script( 'mediaelement-core', sprintf( 'var mejsL10n = %s;', wp_json_encode( array(
1096
 
                'language' => strtolower( strtok( determine_locale(), '_-' ) ),
1097
 
                'strings'  => array(
1098
 
                        'mejs.install-flash'       => __( 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/' ),
1099
 
                        'mejs.fullscreen-off'      => __( 'Turn off Fullscreen' ),
1100
 
                        'mejs.fullscreen-on'       => __( 'Go Fullscreen' ),
1101
 
                        'mejs.download-video'      => __( 'Download Video' ),
1102
 
                        'mejs.fullscreen'          => __( 'Fullscreen' ),
1103
 
                        'mejs.time-jump-forward'   => array( __( 'Jump forward 1 second' ), __( 'Jump forward %1 seconds' ) ),
1104
 
                        'mejs.loop'                => __( 'Toggle Loop' ),
1105
 
                        'mejs.play'                => __( 'Play' ),
1106
 
                        'mejs.pause'               => __( 'Pause' ),
1107
 
                        'mejs.close'               => __( 'Close' ),
1108
 
                        'mejs.time-slider'         => __( 'Time Slider' ),
1109
 
                        'mejs.time-help-text'      => __( 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.' ),
1110
 
                        'mejs.time-skip-back'      => array( __( 'Skip back 1 second' ), __( 'Skip back %1 seconds' ) ),
1111
 
                        'mejs.captions-subtitles'  => __( 'Captions/Subtitles' ),
1112
 
                        'mejs.captions-chapters'   => __( 'Chapters' ),
1113
 
                        'mejs.none'                => __( 'None' ),
1114
 
                        'mejs.mute-toggle'         => __( 'Mute Toggle' ),
1115
 
                        'mejs.volume-help-text'    => __( 'Use Up/Down Arrow keys to increase or decrease volume.' ),
1116
 
                        'mejs.unmute'              => __( 'Unmute' ),
1117
 
                        'mejs.mute'                => __( 'Mute' ),
1118
 
                        'mejs.volume-slider'       => __( 'Volume Slider' ),
1119
 
                        'mejs.video-player'        => __( 'Video Player' ),
1120
 
                        'mejs.audio-player'        => __( 'Audio Player' ),
1121
 
                        'mejs.ad-skip'             => __( 'Skip ad' ),
1122
 
                        'mejs.ad-skip-info'        => array( __( 'Skip in 1 second' ), __( 'Skip in %1 seconds' ) ),
1123
 
                        'mejs.source-chooser'      => __( 'Source Chooser' ),
1124
 
                        'mejs.stop'                => __( 'Stop' ),
1125
 
                        'mejs.speed-rate'          => __( 'Speed Rate' ),
1126
 
                        'mejs.live-broadcast'      => __( 'Live Broadcast' ),
1127
 
                        'mejs.afrikaans'           => __( 'Afrikaans' ),
1128
 
                        'mejs.albanian'            => __( 'Albanian' ),
1129
 
                        'mejs.arabic'              => __( 'Arabic' ),
1130
 
                        'mejs.belarusian'          => __( 'Belarusian' ),
1131
 
                        'mejs.bulgarian'           => __( 'Bulgarian' ),
1132
 
                        'mejs.catalan'             => __( 'Catalan' ),
1133
 
                        'mejs.chinese'             => __( 'Chinese' ),
1134
 
                        'mejs.chinese-simplified'  => __( 'Chinese (Simplified)' ),
1135
 
                        'mejs.chinese-traditional' => __( 'Chinese (Traditional)' ),
1136
 
                        'mejs.croatian'            => __( 'Croatian' ),
1137
 
                        'mejs.czech'               => __( 'Czech' ),
1138
 
                        'mejs.danish'              => __( 'Danish' ),
1139
 
                        'mejs.dutch'               => __( 'Dutch' ),
1140
 
                        'mejs.english'             => __( 'English' ),
1141
 
                        'mejs.estonian'            => __( 'Estonian' ),
1142
 
                        'mejs.filipino'            => __( 'Filipino' ),
1143
 
                        'mejs.finnish'             => __( 'Finnish' ),
1144
 
                        'mejs.french'              => __( 'French' ),
1145
 
                        'mejs.galician'            => __( 'Galician' ),
1146
 
                        'mejs.german'              => __( 'German' ),
1147
 
                        'mejs.greek'               => __( 'Greek' ),
1148
 
                        'mejs.haitian-creole'      => __( 'Haitian Creole' ),
1149
 
                        'mejs.hebrew'              => __( 'Hebrew' ),
1150
 
                        'mejs.hindi'               => __( 'Hindi' ),
1151
 
                        'mejs.hungarian'           => __( 'Hungarian' ),
1152
 
                        'mejs.icelandic'           => __( 'Icelandic' ),
1153
 
                        'mejs.indonesian'          => __( 'Indonesian' ),
1154
 
                        'mejs.irish'               => __( 'Irish' ),
1155
 
                        'mejs.italian'             => __( 'Italian' ),
1156
 
                        'mejs.japanese'            => __( 'Japanese' ),
1157
 
                        'mejs.korean'              => __( 'Korean' ),
1158
 
                        'mejs.latvian'             => __( 'Latvian' ),
1159
 
                        'mejs.lithuanian'          => __( 'Lithuanian' ),
1160
 
                        'mejs.macedonian'          => __( 'Macedonian' ),
1161
 
                        'mejs.malay'               => __( 'Malay' ),
1162
 
                        'mejs.maltese'             => __( 'Maltese' ),
1163
 
                        'mejs.norwegian'           => __( 'Norwegian' ),
1164
 
                        'mejs.persian'             => __( 'Persian' ),
1165
 
                        'mejs.polish'              => __( 'Polish' ),
1166
 
                        'mejs.portuguese'          => __( 'Portuguese' ),
1167
 
                        'mejs.romanian'            => __( 'Romanian' ),
1168
 
                        'mejs.russian'             => __( 'Russian' ),
1169
 
                        'mejs.serbian'             => __( 'Serbian' ),
1170
 
                        'mejs.slovak'              => __( 'Slovak' ),
1171
 
                        'mejs.slovenian'           => __( 'Slovenian' ),
1172
 
                        'mejs.spanish'             => __( 'Spanish' ),
1173
 
                        'mejs.swahili'             => __( 'Swahili' ),
1174
 
                        'mejs.swedish'             => __( 'Swedish' ),
1175
 
                        'mejs.tagalog'             => __( 'Tagalog' ),
1176
 
                        'mejs.thai'                => __( 'Thai' ),
1177
 
                        'mejs.turkish'             => __( 'Turkish' ),
1178
 
                        'mejs.ukrainian'           => __( 'Ukrainian' ),
1179
 
                        'mejs.vietnamese'          => __( 'Vietnamese' ),
1180
 
                        'mejs.welsh'               => __( 'Welsh' ),
1181
 
                        'mejs.yiddish'             => __( 'Yiddish' ),
1182
 
                        ),
1183
 
                ) ) ), 'before' );
1184
 
 
1185
 
 
1186
 
        $scripts->add( 'mediaelement-vimeo', "/wp-includes/js/mediaelement/renderers/vimeo.min.js", array('mediaelement'), '4.2.6-78496d1', 1 );
1187
 
        $scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement$suffix.js", array('mediaelement'), false, 1 );
 
1136
        $scripts->add( 'mediaelement-migrate', "/wp-includes/js/mediaelement/mediaelement-migrate$suffix.js", array(), false, 1 );
 
1137
 
 
1138
        did_action( 'init' ) && $scripts->add_inline_script(
 
1139
                'mediaelement-core',
 
1140
                sprintf(
 
1141
                        'var mejsL10n = %s;',
 
1142
                        wp_json_encode(
 
1143
                                array(
 
1144
                                        'language' => strtolower( strtok( determine_locale(), '_-' ) ),
 
1145
                                        'strings'  => array(
 
1146
                                                'mejs.install-flash'       => __( 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/' ),
 
1147
                                                'mejs.fullscreen-off'      => __( 'Turn off Fullscreen' ),
 
1148
                                                'mejs.fullscreen-on'       => __( 'Go Fullscreen' ),
 
1149
                                                'mejs.download-video'      => __( 'Download Video' ),
 
1150
                                                'mejs.fullscreen'          => __( 'Fullscreen' ),
 
1151
                                                'mejs.time-jump-forward'   => array( __( 'Jump forward 1 second' ), __( 'Jump forward %1 seconds' ) ),
 
1152
                                                'mejs.loop'                => __( 'Toggle Loop' ),
 
1153
                                                'mejs.play'                => __( 'Play' ),
 
1154
                                                'mejs.pause'               => __( 'Pause' ),
 
1155
                                                'mejs.close'               => __( 'Close' ),
 
1156
                                                'mejs.time-slider'         => __( 'Time Slider' ),
 
1157
                                                'mejs.time-help-text'      => __( 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.' ),
 
1158
                                                'mejs.time-skip-back'      => array( __( 'Skip back 1 second' ), __( 'Skip back %1 seconds' ) ),
 
1159
                                                'mejs.captions-subtitles'  => __( 'Captions/Subtitles' ),
 
1160
                                                'mejs.captions-chapters'   => __( 'Chapters' ),
 
1161
                                                'mejs.none'                => __( 'None' ),
 
1162
                                                'mejs.mute-toggle'         => __( 'Mute Toggle' ),
 
1163
                                                'mejs.volume-help-text'    => __( 'Use Up/Down Arrow keys to increase or decrease volume.' ),
 
1164
                                                'mejs.unmute'              => __( 'Unmute' ),
 
1165
                                                'mejs.mute'                => __( 'Mute' ),
 
1166
                                                'mejs.volume-slider'       => __( 'Volume Slider' ),
 
1167
                                                'mejs.video-player'        => __( 'Video Player' ),
 
1168
                                                'mejs.audio-player'        => __( 'Audio Player' ),
 
1169
                                                'mejs.ad-skip'             => __( 'Skip ad' ),
 
1170
                                                'mejs.ad-skip-info'        => array( __( 'Skip in 1 second' ), __( 'Skip in %1 seconds' ) ),
 
1171
                                                'mejs.source-chooser'      => __( 'Source Chooser' ),
 
1172
                                                'mejs.stop'                => __( 'Stop' ),
 
1173
                                                'mejs.speed-rate'          => __( 'Speed Rate' ),
 
1174
                                                'mejs.live-broadcast'      => __( 'Live Broadcast' ),
 
1175
                                                'mejs.afrikaans'           => __( 'Afrikaans' ),
 
1176
                                                'mejs.albanian'            => __( 'Albanian' ),
 
1177
                                                'mejs.arabic'              => __( 'Arabic' ),
 
1178
                                                'mejs.belarusian'          => __( 'Belarusian' ),
 
1179
                                                'mejs.bulgarian'           => __( 'Bulgarian' ),
 
1180
                                                'mejs.catalan'             => __( 'Catalan' ),
 
1181
                                                'mejs.chinese'             => __( 'Chinese' ),
 
1182
                                                'mejs.chinese-simplified'  => __( 'Chinese (Simplified)' ),
 
1183
                                                'mejs.chinese-traditional' => __( 'Chinese (Traditional)' ),
 
1184
                                                'mejs.croatian'            => __( 'Croatian' ),
 
1185
                                                'mejs.czech'               => __( 'Czech' ),
 
1186
                                                'mejs.danish'              => __( 'Danish' ),
 
1187
                                                'mejs.dutch'               => __( 'Dutch' ),
 
1188
                                                'mejs.english'             => __( 'English' ),
 
1189
                                                'mejs.estonian'            => __( 'Estonian' ),
 
1190
                                                'mejs.filipino'            => __( 'Filipino' ),
 
1191
                                                'mejs.finnish'             => __( 'Finnish' ),
 
1192
                                                'mejs.french'              => __( 'French' ),
 
1193
                                                'mejs.galician'            => __( 'Galician' ),
 
1194
                                                'mejs.german'              => __( 'German' ),
 
1195
                                                'mejs.greek'               => __( 'Greek' ),
 
1196
                                                'mejs.haitian-creole'      => __( 'Haitian Creole' ),
 
1197
                                                'mejs.hebrew'              => __( 'Hebrew' ),
 
1198
                                                'mejs.hindi'               => __( 'Hindi' ),
 
1199
                                                'mejs.hungarian'           => __( 'Hungarian' ),
 
1200
                                                'mejs.icelandic'           => __( 'Icelandic' ),
 
1201
                                                'mejs.indonesian'          => __( 'Indonesian' ),
 
1202
                                                'mejs.irish'               => __( 'Irish' ),
 
1203
                                                'mejs.italian'             => __( 'Italian' ),
 
1204
                                                'mejs.japanese'            => __( 'Japanese' ),
 
1205
                                                'mejs.korean'              => __( 'Korean' ),
 
1206
                                                'mejs.latvian'             => __( 'Latvian' ),
 
1207
                                                'mejs.lithuanian'          => __( 'Lithuanian' ),
 
1208
                                                'mejs.macedonian'          => __( 'Macedonian' ),
 
1209
                                                'mejs.malay'               => __( 'Malay' ),
 
1210
                                                'mejs.maltese'             => __( 'Maltese' ),
 
1211
                                                'mejs.norwegian'           => __( 'Norwegian' ),
 
1212
                                                'mejs.persian'             => __( 'Persian' ),
 
1213
                                                'mejs.polish'              => __( 'Polish' ),
 
1214
                                                'mejs.portuguese'          => __( 'Portuguese' ),
 
1215
                                                'mejs.romanian'            => __( 'Romanian' ),
 
1216
                                                'mejs.russian'             => __( 'Russian' ),
 
1217
                                                'mejs.serbian'             => __( 'Serbian' ),
 
1218
                                                'mejs.slovak'              => __( 'Slovak' ),
 
1219
                                                'mejs.slovenian'           => __( 'Slovenian' ),
 
1220
                                                'mejs.spanish'             => __( 'Spanish' ),
 
1221
                                                'mejs.swahili'             => __( 'Swahili' ),
 
1222
                                                'mejs.swedish'             => __( 'Swedish' ),
 
1223
                                                'mejs.tagalog'             => __( 'Tagalog' ),
 
1224
                                                'mejs.thai'                => __( 'Thai' ),
 
1225
                                                'mejs.turkish'             => __( 'Turkish' ),
 
1226
                                                'mejs.ukrainian'           => __( 'Ukrainian' ),
 
1227
                                                'mejs.vietnamese'          => __( 'Vietnamese' ),
 
1228
                                                'mejs.welsh'               => __( 'Welsh' ),
 
1229
                                                'mejs.yiddish'             => __( 'Yiddish' ),
 
1230
                                        ),
 
1231
                                )
 
1232
                        )
 
1233
                ),
 
1234
                'before'
 
1235
        );
 
1236
 
 
1237
        $scripts->add( 'mediaelement-vimeo', '/wp-includes/js/mediaelement/renderers/vimeo.min.js', array( 'mediaelement' ), '4.2.6-78496d1', 1 );
 
1238
        $scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement$suffix.js", array( 'mediaelement' ), false, 1 );
1188
1239
        $mejs_settings = array(
1189
 
                'pluginPath'    => includes_url( 'js/mediaelement/', 'relative' ),
1190
 
                'classPrefix'   => 'mejs-',
1191
 
                'stretching'    => 'responsive',
 
1240
                'pluginPath'  => includes_url( 'js/mediaelement/', 'relative' ),
 
1241
                'classPrefix' => 'mejs-',
 
1242
                'stretching'  => 'responsive',
1192
1243
        );
1193
 
        did_action( 'init' ) && $scripts->localize( 'mediaelement', '_wpmejsSettings',
 
1244
        did_action( 'init' ) && $scripts->localize(
 
1245
                'mediaelement',
 
1246
                '_wpmejsSettings',
1194
1247
                /**
1195
1248
                 * Filters the MediaElement configuration settings.
1196
1249
                 *
1203
1256
 
1204
1257
        $scripts->add( 'wp-codemirror', '/wp-includes/js/codemirror/codemirror.min.js', array(), '5.29.1-alpha-ee20357' );
1205
1258
        $scripts->add( 'csslint', '/wp-includes/js/codemirror/csslint.js', array(), '1.0.5' );
1206
 
        $scripts->add( 'jshint', '/wp-includes/js/codemirror/jshint.js', array(), '2.9.5.999' );
 
1259
        $scripts->add( 'esprima', '/wp-includes/js/codemirror/esprima.js', array(), '4.0.0' );
 
1260
        $scripts->add( 'jshint', '/wp-includes/js/codemirror/fakejshint.js', array( 'esprima' ), '2.9.5' );
1207
1261
        $scripts->add( 'jsonlint', '/wp-includes/js/codemirror/jsonlint.js', array(), '1.6.2' );
1208
1262
        $scripts->add( 'htmlhint', '/wp-includes/js/codemirror/htmlhint.js', array(), '0.9.14-xwp' );
1209
1263
        $scripts->add( 'htmlhint-kses', '/wp-includes/js/codemirror/htmlhint-kses.js', array( 'htmlhint' ) );
1210
1264
        $scripts->add( 'code-editor', "/wp-admin/js/code-editor$suffix.js", array( 'jquery', 'wp-codemirror', 'underscore' ) );
1211
1265
        $scripts->add( 'wp-theme-plugin-editor', "/wp-admin/js/theme-plugin-editor$suffix.js", array( 'wp-util', 'wp-sanitize', 'jquery', 'jquery-ui-core', 'wp-a11y', 'underscore' ) );
1212
 
        did_action( 'init' ) && $scripts->add_inline_script( 'wp-theme-plugin-editor', sprintf( 'wp.themePluginEditor.l10n = %s;', wp_json_encode( array(
1213
 
                'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
1214
 
                'saveError' => __( 'Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.' ),
1215
 
                'lintError' => array(
1216
 
                        /* translators: %d: error count */
1217
 
                        'singular' => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 1 ),
1218
 
                        /* translators: %d: error count */
1219
 
                        'plural' => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
1220
 
                ),
1221
 
        ) ) ) );
 
1266
        did_action( 'init' ) && $scripts->add_inline_script(
 
1267
                'wp-theme-plugin-editor',
 
1268
                sprintf(
 
1269
                        'wp.themePluginEditor.l10n = %s;',
 
1270
                        wp_json_encode(
 
1271
                                array(
 
1272
                                        'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
 
1273
                                        'saveError' => __( 'Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.' ),
 
1274
                                        'lintError' => array(
 
1275
                                                /* translators: %d: error count */
 
1276
                                                'singular' => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 1 ),
 
1277
                                                /* translators: %d: error count */
 
1278
                                                'plural'   => _n( 'There is %d error which must be fixed before you can update this file.', 'There are %d errors which must be fixed before you can update this file.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
 
1279
                                        ),
 
1280
                                )
 
1281
                        )
 
1282
                )
 
1283
        );
1222
1284
 
1223
1285
        $scripts->add( 'wp-playlist', "/wp-includes/js/mediaelement/wp-playlist$suffix.js", array( 'wp-util', 'backbone', 'mediaelement' ), false, 1 );
1224
1286
 
1225
1287
        $scripts->add( 'zxcvbn-async', "/wp-includes/js/zxcvbn-async$suffix.js", array(), '1.0' );
1226
 
        did_action( 'init' ) && $scripts->localize( 'zxcvbn-async', '_zxcvbnSettings', array(
1227
 
                'src' => empty( $guessed_url ) ? includes_url( '/js/zxcvbn.min.js' ) : $scripts->base_url . '/wp-includes/js/zxcvbn.min.js',
1228
 
        ) );
 
1288
        did_action( 'init' ) && $scripts->localize(
 
1289
                'zxcvbn-async',
 
1290
                '_zxcvbnSettings',
 
1291
                array(
 
1292
                        'src' => empty( $guessed_url ) ? includes_url( '/js/zxcvbn.min.js' ) : $scripts->base_url . '/wp-includes/js/zxcvbn.min.js',
 
1293
                )
 
1294
        );
1229
1295
 
1230
1296
        $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array( 'jquery', 'zxcvbn-async' ), false, 1 );
1231
 
        did_action( 'init' ) && $scripts->localize( 'password-strength-meter', 'pwsL10n', array(
1232
 
                'unknown'  => _x( 'Password strength unknown', 'password strength' ),
1233
 
                'short'    => _x( 'Very weak', 'password strength' ),
1234
 
                'bad'      => _x( 'Weak', 'password strength' ),
1235
 
                'good'     => _x( 'Medium', 'password strength' ),
1236
 
                'strong'   => _x( 'Strong', 'password strength' ),
1237
 
                'mismatch' => _x( 'Mismatch', 'password mismatch' ),
1238
 
        ) );
 
1297
        did_action( 'init' ) && $scripts->localize(
 
1298
                'password-strength-meter',
 
1299
                'pwsL10n',
 
1300
                array(
 
1301
                        'unknown'  => _x( 'Password strength unknown', 'password strength' ),
 
1302
                        'short'    => _x( 'Very weak', 'password strength' ),
 
1303
                        'bad'      => _x( 'Weak', 'password strength' ),
 
1304
                        'good'     => _x( 'Medium', 'password strength' ),
 
1305
                        'strong'   => _x( 'Strong', 'password strength' ),
 
1306
                        'mismatch' => _x( 'Mismatch', 'password mismatch' ),
 
1307
                )
 
1308
        );
1239
1309
 
1240
1310
        $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter', 'wp-util' ), false, 1 );
1241
 
        did_action( 'init' ) && $scripts->localize( 'user-profile', 'userProfileL10n', array(
1242
 
                'warn'     => __( 'Your new password has not been saved.' ),
1243
 
                'warnWeak' => __( 'Confirm use of weak password' ),
1244
 
                'show'     => __( 'Show' ),
1245
 
                'hide'     => __( 'Hide' ),
1246
 
                'cancel'   => __( 'Cancel' ),
1247
 
                'ariaShow' => esc_attr__( 'Show password' ),
1248
 
                'ariaHide' => esc_attr__( 'Hide password' ),
1249
 
        ) );
 
1311
        did_action( 'init' ) && $scripts->localize(
 
1312
                'user-profile',
 
1313
                'userProfileL10n',
 
1314
                array(
 
1315
                        'warn'     => __( 'Your new password has not been saved.' ),
 
1316
                        'warnWeak' => __( 'Confirm use of weak password' ),
 
1317
                        'show'     => __( 'Show' ),
 
1318
                        'hide'     => __( 'Hide' ),
 
1319
                        'cancel'   => __( 'Cancel' ),
 
1320
                        'ariaShow' => esc_attr__( 'Show password' ),
 
1321
                        'ariaHide' => esc_attr__( 'Hide password' ),
 
1322
                )
 
1323
        );
1250
1324
 
1251
1325
        $scripts->add( 'language-chooser', "/wp-admin/js/language-chooser$suffix.js", array( 'jquery' ), false, 1 );
1252
1326
 
1255
1329
        $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );
1256
1330
 
1257
1331
        $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
1258
 
        did_action( 'init' ) && $scripts->localize( 'wplink', 'wpLinkL10n', array(
1259
 
                'title' => __('Insert/edit link'),
1260
 
                'update' => __('Update'),
1261
 
                'save' => __('Add Link'),
1262
 
                'noTitle' => __('(no title)'),
1263
 
                'noMatchesFound' => __('No results found.'),
1264
 
                'linkSelected' => __( 'Link selected.' ),
1265
 
                'linkInserted' => __( 'Link inserted.' ),
1266
 
        ) );
 
1332
        did_action( 'init' ) && $scripts->localize(
 
1333
                'wplink',
 
1334
                'wpLinkL10n',
 
1335
                array(
 
1336
                        'title'          => __( 'Insert/edit link' ),
 
1337
                        'update'         => __( 'Update' ),
 
1338
                        'save'           => __( 'Add Link' ),
 
1339
                        'noTitle'        => __( '(no title)' ),
 
1340
                        'noMatchesFound' => __( 'No results found.' ),
 
1341
                        'linkSelected'   => __( 'Link selected.' ),
 
1342
                        'linkInserted'   => __( 'Link inserted.' ),
 
1343
                )
 
1344
        );
1267
1345
 
1268
1346
        $scripts->add( 'wpdialogs', "/wp-includes/js/wpdialog$suffix.js", array( 'jquery-ui-dialog' ), false, 1 );
1269
1347
 
1271
1349
 
1272
1350
        $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'shortcode' ), false, 1 );
1273
1351
 
1274
 
        $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '1.8.1', 1 );
 
1352
        $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array( 'jquery' ), '1.8.1', 1 );
1275
1353
 
1276
 
        $scripts->add( 'customize-base',     "/wp-includes/js/customize-base$suffix.js",     array( 'jquery', 'json2', 'underscore' ), false, 1 );
1277
 
        $scripts->add( 'customize-loader',   "/wp-includes/js/customize-loader$suffix.js",   array( 'customize-base' ), false, 1 );
1278
 
        $scripts->add( 'customize-preview',  "/wp-includes/js/customize-preview$suffix.js",  array( 'wp-a11y', 'customize-base' ), false, 1 );
1279
 
        $scripts->add( 'customize-models',   "/wp-includes/js/customize-models.js", array( 'underscore', 'backbone' ), false, 1 );
1280
 
        $scripts->add( 'customize-views',    "/wp-includes/js/customize-views.js",  array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 );
 
1354
        $scripts->add( 'customize-base', "/wp-includes/js/customize-base$suffix.js", array( 'jquery', 'json2', 'underscore' ), false, 1 );
 
1355
        $scripts->add( 'customize-loader', "/wp-includes/js/customize-loader$suffix.js", array( 'customize-base' ), false, 1 );
 
1356
        $scripts->add( 'customize-preview', "/wp-includes/js/customize-preview$suffix.js", array( 'wp-a11y', 'customize-base' ), false, 1 );
 
1357
        $scripts->add( 'customize-models', '/wp-includes/js/customize-models.js', array( 'underscore', 'backbone' ), false, 1 );
 
1358
        $scripts->add( 'customize-views', '/wp-includes/js/customize-views.js', array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 );
1281
1359
        $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util', 'jquery-ui-core' ), false, 1 );
1282
 
        did_action( 'init' ) && $scripts->localize( 'customize-controls', '_wpCustomizeControlsL10n', array(
1283
 
                'activate'           => __( 'Activate & Publish' ),
1284
 
                'save'               => __( 'Save & Publish' ), // @todo Remove as not required.
1285
 
                'publish'            => __( 'Publish' ),
1286
 
                'published'          => __( 'Published' ),
1287
 
                'saveDraft'          => __( 'Save Draft' ),
1288
 
                'draftSaved'         => __( 'Draft Saved' ),
1289
 
                'updating'           => __( 'Updating' ),
1290
 
                'schedule'           => _x( 'Schedule', 'customizer changeset action/button label' ),
1291
 
                'scheduled'          => _x( 'Scheduled', 'customizer changeset status' ),
1292
 
                'invalid'            => __( 'Invalid' ),
1293
 
                'saveBeforeShare'    => __( 'Please save your changes in order to share the preview.' ),
1294
 
                'futureDateError'    => __( 'You must supply a future date to schedule.' ),
1295
 
                'saveAlert'          => __( 'The changes you made will be lost if you navigate away from this page.' ),
1296
 
                'saved'              => __( 'Saved' ),
1297
 
                'cancel'             => __( 'Cancel' ),
1298
 
                'close'              => __( 'Close' ),
1299
 
                'action'             => __( 'Action' ),
1300
 
                'discardChanges'     => __( 'Discard changes' ),
1301
 
                'cheatin'            => __( 'Something went wrong.' ),
1302
 
                'notAllowedHeading'  => __( 'You need a higher level of permission.' ),
1303
 
                'notAllowed'         => __( 'Sorry, you are not allowed to customize this site.' ),
1304
 
                'previewIframeTitle' => __( 'Site Preview' ),
1305
 
                'loginIframeTitle'   => __( 'Session expired' ),
1306
 
                'collapseSidebar'    => _x( 'Hide Controls', 'label for hide controls button without length constraints' ),
1307
 
                'expandSidebar'      => _x( 'Show Controls', 'label for hide controls button without length constraints' ),
1308
 
                'untitledBlogName'   => __( '(Untitled)' ),
1309
 
                'unknownRequestFail' => __( 'Looks like something’s gone wrong. Wait a couple seconds, and then try again.' ),
1310
 
                'themeDownloading'   => __( 'Downloading your new theme…' ),
1311
 
                'themePreviewWait'   => __( 'Setting up your live preview. This may take a bit.' ),
1312
 
                'revertingChanges'   => __( 'Reverting unpublished changes…' ),
1313
 
                'trashConfirm'       => __( 'Are you sure you’d like to discard your unpublished changes?' ),
1314
 
                /* translators: %s: Display name of the user who has taken over the changeset in customizer. */
1315
 
                'takenOverMessage'   => __( '%s has taken over and is currently customizing.' ),
1316
 
                /* translators: %s: URL to the Customizer to load the autosaved version */
1317
 
                'autosaveNotice'     => __( 'There is a more recent autosave of your changes than the one you are previewing. <a href="%s">Restore the autosave</a>' ),
1318
 
                'videoHeaderNotice'  => __( 'This theme doesn&#8217;t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),
1319
 
                // Used for overriding the file types allowed in plupload.
1320
 
                'allowedFiles'       => __( 'Allowed Files' ),
1321
 
                'customCssError'     => array(
1322
 
                        /* translators: %d: error count */
1323
 
                        'singular' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 1 ),
1324
 
                        /* translators: %d: error count */
1325
 
                        'plural'   => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
1326
 
                ),
1327
 
                'pageOnFrontError' => __( 'Homepage and posts page must be different.' ),
1328
 
                'saveBlockedError' => array(
1329
 
                        /* translators: %s: number of invalid settings */
1330
 
                        'singular' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 1 ),
1331
 
                        /* translators: %s: number of invalid settings */
1332
 
                        'plural'   => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
1333
 
                ),
1334
 
                'scheduleDescription' => __( 'Schedule your customization changes to publish ("go live") at a future date.' ),
1335
 
                'themePreviewUnavailable' => __( 'Sorry, you can&#8217;t preview new themes when you have changes scheduled or saved as a draft. Please publish your changes, or wait until they publish to preview new themes.' ),
1336
 
                'themeInstallUnavailable' => sprintf(
1337
 
                        /* translators: %s: URL to Add Themes admin screen */
1338
 
                        __( 'You won&#8217;t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ),
1339
 
                        esc_url( admin_url( 'theme-install.php' ) )
1340
 
                ),
1341
 
                'publishSettings' => __( 'Publish Settings' ),
1342
 
                'invalidDate'     => __( 'Invalid date.' ),
1343
 
                'invalidValue'    => __( 'Invalid value.' ),
1344
 
        ) );
 
1360
        did_action( 'init' ) && $scripts->localize(
 
1361
                'customize-controls',
 
1362
                '_wpCustomizeControlsL10n',
 
1363
                array(
 
1364
                        'activate'                => __( 'Activate &amp; Publish' ),
 
1365
                        'save'                    => __( 'Save &amp; Publish' ), // @todo Remove as not required.
 
1366
                        'publish'                 => __( 'Publish' ),
 
1367
                        'published'               => __( 'Published' ),
 
1368
                        'saveDraft'               => __( 'Save Draft' ),
 
1369
                        'draftSaved'              => __( 'Draft Saved' ),
 
1370
                        'updating'                => __( 'Updating' ),
 
1371
                        'schedule'                => _x( 'Schedule', 'customizer changeset action/button label' ),
 
1372
                        'scheduled'               => _x( 'Scheduled', 'customizer changeset status' ),
 
1373
                        'invalid'                 => __( 'Invalid' ),
 
1374
                        'saveBeforeShare'         => __( 'Please save your changes in order to share the preview.' ),
 
1375
                        'futureDateError'         => __( 'You must supply a future date to schedule.' ),
 
1376
                        'saveAlert'               => __( 'The changes you made will be lost if you navigate away from this page.' ),
 
1377
                        'saved'                   => __( 'Saved' ),
 
1378
                        'cancel'                  => __( 'Cancel' ),
 
1379
                        'close'                   => __( 'Close' ),
 
1380
                        'action'                  => __( 'Action' ),
 
1381
                        'discardChanges'          => __( 'Discard changes' ),
 
1382
                        'cheatin'                 => __( 'Something went wrong.' ),
 
1383
                        'notAllowedHeading'       => __( 'You need a higher level of permission.' ),
 
1384
                        'notAllowed'              => __( 'Sorry, you are not allowed to customize this site.' ),
 
1385
                        'previewIframeTitle'      => __( 'Site Preview' ),
 
1386
                        'loginIframeTitle'        => __( 'Session expired' ),
 
1387
                        'collapseSidebar'         => _x( 'Hide Controls', 'label for hide controls button without length constraints' ),
 
1388
                        'expandSidebar'           => _x( 'Show Controls', 'label for hide controls button without length constraints' ),
 
1389
                        'untitledBlogName'        => __( '(Untitled)' ),
 
1390
                        'unknownRequestFail'      => __( 'Looks like something&#8217;s gone wrong. Wait a couple seconds, and then try again.' ),
 
1391
                        'themeDownloading'        => __( 'Downloading your new theme&hellip;' ),
 
1392
                        'themePreviewWait'        => __( 'Setting up your live preview. This may take a bit.' ),
 
1393
                        'revertingChanges'        => __( 'Reverting unpublished changes&hellip;' ),
 
1394
                        'trashConfirm'            => __( 'Are you sure you&#8217;d like to discard your unpublished changes?' ),
 
1395
                        /* translators: %s: Display name of the user who has taken over the changeset in customizer. */
 
1396
                        'takenOverMessage'        => __( '%s has taken over and is currently customizing.' ),
 
1397
                        /* translators: %s: URL to the Customizer to load the autosaved version */
 
1398
                        'autosaveNotice'          => __( 'There is a more recent autosave of your changes than the one you are previewing. <a href="%s">Restore the autosave</a>' ),
 
1399
                        'videoHeaderNotice'       => __( 'This theme doesn&#8217;t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),
 
1400
                        // Used for overriding the file types allowed in plupload.
 
1401
                        'allowedFiles'            => __( 'Allowed Files' ),
 
1402
                        'customCssError'          => array(
 
1403
                                /* translators: %d: error count */
 
1404
                                'singular' => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 1 ),
 
1405
                                /* translators: %d: error count */
 
1406
                                'plural'   => _n( 'There is %d error which must be fixed before you can save.', 'There are %d errors which must be fixed before you can save.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
 
1407
                        ),
 
1408
                        'pageOnFrontError'        => __( 'Homepage and posts page must be different.' ),
 
1409
                        'saveBlockedError'        => array(
 
1410
                                /* translators: %s: number of invalid settings */
 
1411
                                'singular' => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 1 ),
 
1412
                                /* translators: %s: number of invalid settings */
 
1413
                                'plural'   => _n( 'Unable to save due to %s invalid setting.', 'Unable to save due to %s invalid settings.', 2 ), // @todo This is lacking, as some languages have a dedicated dual form. For proper handling of plurals in JS, see #20491.
 
1414
                        ),
 
1415
                        'scheduleDescription'     => __( 'Schedule your customization changes to publish ("go live") at a future date.' ),
 
1416
                        'themePreviewUnavailable' => __( 'Sorry, you can&#8217;t preview new themes when you have changes scheduled or saved as a draft. Please publish your changes, or wait until they publish to preview new themes.' ),
 
1417
                        'themeInstallUnavailable' => sprintf(
 
1418
                                /* translators: %s: URL to Add Themes admin screen */
 
1419
                                   __( 'You won&#8217;t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ),
 
1420
                                esc_url( admin_url( 'theme-install.php' ) )
 
1421
                        ),
 
1422
                        'publishSettings'         => __( 'Publish Settings' ),
 
1423
                        'invalidDate'             => __( 'Invalid date.' ),
 
1424
                        'invalidValue'            => __( 'Invalid value.' ),
 
1425
                )
 
1426
        );
1345
1427
        $scripts->add( 'customize-selective-refresh', "/wp-includes/js/customize-selective-refresh$suffix.js", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 );
1346
1428
 
1347
1429
        $scripts->add( 'customize-widgets', "/wp-admin/js/customize-widgets$suffix.js", array( 'jquery', 'jquery-ui-sortable', 'jquery-ui-droppable', 'wp-backbone', 'customize-controls' ), false, 1 );
1356
1438
 
1357
1439
        $scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );
1358
1440
        $scripts->add( 'media-models', "/wp-includes/js/media-models$suffix.js", array( 'wp-backbone' ), false, 1 );
1359
 
        did_action( 'init' ) && $scripts->localize( 'media-models', '_wpMediaModelsL10n', array(
1360
 
                'settings' => array(
1361
 
                        'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
1362
 
                        'post' => array( 'id' => 0 ),
1363
 
                ),
1364
 
        ) );
 
1441
        did_action( 'init' ) && $scripts->localize(
 
1442
                'media-models',
 
1443
                '_wpMediaModelsL10n',
 
1444
                array(
 
1445
                        'settings' => array(
 
1446
                                'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
 
1447
                                'post'    => array( 'id' => 0 ),
 
1448
                        ),
 
1449
                )
 
1450
        );
1365
1451
 
1366
1452
        $scripts->add( 'wp-embed', "/wp-includes/js/wp-embed$suffix.js" );
1367
1453
 
1368
1454
        // To enqueue media-views or media-editor, call wp_enqueue_media().
1369
1455
        // Both rely on numerous settings, styles, and templates to operate correctly.
1370
 
        $scripts->add( 'media-views',  "/wp-includes/js/media-views$suffix.js",  array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement', 'wp-api-request' ), false, 1 );
 
1456
        $scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement', 'wp-api-request' ), false, 1 );
1371
1457
        $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 );
1372
1458
        $scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor' ), false, 1 );
1373
1459
        $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'jquery', 'media-views', 'media-audiovideo' ), false, 1 );
1376
1462
 
1377
1463
        if ( is_admin() ) {
1378
1464
                $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array( 'jquery', 'wp-ajax-response' ), false, 1 );
1379
 
                did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array(
1380
 
                        'noPerm' => __('Sorry, you are not allowed to do that.'),
1381
 
                        'broken' => __('Something went wrong.')
1382
 
                ));
1383
 
 
1384
 
                $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'quicktags', 'jquery-query'), false, 1 );
1385
 
                did_action( 'init' ) && $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
1386
 
                        'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
1387
 
                        'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']),
1388
 
                        'replyApprove' => __( 'Approve and Reply' ),
1389
 
                        'reply' => __( 'Reply' ),
1390
 
                        'warnQuickEdit' => __( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ),
1391
 
                        'warnCommentChanges' => __( "Are you sure you want to do this?\nThe comment changes you made will be lost." ),
1392
 
                        'docTitleComments' => __( 'Comments' ),
1393
 
                        /* translators: %s: comments count */
1394
 
                        'docTitleCommentsCount' => __( 'Comments (%s)' ),
1395
 
                ) );
1396
 
 
1397
 
                $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array('jquery'), false, 1 );
1398
 
                did_action( 'init' ) && $scripts->localize(
1399
 
                        'xfn', 'privacyToolsL10n', array(
 
1465
                did_action( 'init' ) && $scripts->localize(
 
1466
                        'admin-tags',
 
1467
                        'tagsl10n',
 
1468
                        array(
 
1469
                                'noPerm' => __( 'Sorry, you are not allowed to do that.' ),
 
1470
                                'broken' => __( 'Something went wrong.' ),
 
1471
                        )
 
1472
                );
 
1473
 
 
1474
                $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array( 'wp-lists', 'quicktags', 'jquery-query' ), false, 1 );
 
1475
                did_action( 'init' ) && $scripts->localize(
 
1476
                        'admin-comments',
 
1477
                        'adminCommentsL10n',
 
1478
                        array(
 
1479
                                'hotkeys_highlight_first' => isset( $_GET['hotkeys_highlight_first'] ),
 
1480
                                'hotkeys_highlight_last'  => isset( $_GET['hotkeys_highlight_last'] ),
 
1481
                                'replyApprove'            => __( 'Approve and Reply' ),
 
1482
                                'reply'                   => __( 'Reply' ),
 
1483
                                'warnQuickEdit'           => __( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ),
 
1484
                                'warnCommentChanges'      => __( "Are you sure you want to do this?\nThe comment changes you made will be lost." ),
 
1485
                                'docTitleComments'        => __( 'Comments' ),
 
1486
                                /* translators: %s: comments count */
 
1487
                                'docTitleCommentsCount'   => __( 'Comments (%s)' ),
 
1488
                        )
 
1489
                );
 
1490
 
 
1491
                $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array( 'jquery' ), false, 1 );
 
1492
                did_action( 'init' ) && $scripts->localize(
 
1493
                        'xfn',
 
1494
                        'privacyToolsL10n',
 
1495
                        array(
1400
1496
                                'noDataFound'     => __( 'No personal data was found for this user.' ),
1401
1497
                                'foundAndRemoved' => __( 'All of the personal data found for this user was erased.' ),
1402
1498
                                'noneRemoved'     => __( 'Personal data was found for this user but was not erased.' ),
1407
1503
                        )
1408
1504
                );
1409
1505
 
1410
 
                $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), false, 1 );
1411
 
                did_action( 'init' ) && $scripts->localize( 'postbox', 'postBoxL10n', array(
1412
 
                        'postBoxEmptyString' => __( 'Drag boxes here' ),
1413
 
                ) );
 
1506
                $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array( 'jquery-ui-sortable' ), false, 1 );
 
1507
                did_action( 'init' ) && $scripts->localize(
 
1508
                        'postbox',
 
1509
                        'postBoxL10n',
 
1510
                        array(
 
1511
                                'postBoxEmptyString' => __( 'Drag boxes here' ),
 
1512
                        )
 
1513
                );
1414
1514
 
1415
1515
                $scripts->add( 'tags-box', "/wp-admin/js/tags-box$suffix.js", array( 'jquery', 'tags-suggest' ), false, 1 );
1416
1516
 
1417
1517
                $scripts->add( 'tags-suggest', "/wp-admin/js/tags-suggest$suffix.js", array( 'jquery-ui-autocomplete', 'wp-a11y' ), false, 1 );
1418
 
                did_action( 'init' ) && $scripts->localize( 'tags-suggest', 'tagsSuggestL10n', array(
1419
 
                        'tagDelimiter' => _x( ',', 'tag delimiter' ),
1420
 
                        'removeTerm'   => __( 'Remove term:' ),
1421
 
                        'termSelected' => __( 'Term selected.' ),
1422
 
                        'termAdded'    => __( 'Term added.' ),
1423
 
                        'termRemoved'  => __( 'Term removed.' ),
1424
 
                ) );
 
1518
                did_action( 'init' ) && $scripts->localize(
 
1519
                        'tags-suggest',
 
1520
                        'tagsSuggestL10n',
 
1521
                        array(
 
1522
                                'tagDelimiter' => _x( ',', 'tag delimiter' ),
 
1523
                                'removeTerm'   => __( 'Remove term:' ),
 
1524
                                'termSelected' => __( 'Term selected.' ),
 
1525
                                'termAdded'    => __( 'Term added.' ),
 
1526
                                'termRemoved'  => __( 'Term removed.' ),
 
1527
                        )
 
1528
                );
1425
1529
 
1426
1530
                $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count', 'wp-a11y' ), false, 1 );
1427
 
                did_action( 'init' ) && $scripts->localize( 'post', 'postL10n', array(
1428
 
                        'ok' => __('OK'),
1429
 
                        'cancel' => __('Cancel'),
1430
 
                        'publishOn' => __('Publish on:'),
1431
 
                        'publishOnFuture' =>  __('Schedule for:'),
1432
 
                        'publishOnPast' => __('Published on:'),
1433
 
                        /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
1434
 
                        'dateFormat' => __('%1$s %2$s, %3$s @ %4$s:%5$s'),
1435
 
                        'showcomm' => __('Show more comments'),
1436
 
                        'endcomm' => __('No more comments found.'),
1437
 
                        'publish' => __('Publish'),
1438
 
                        'schedule' => _x('Schedule', 'post action/button label'),
1439
 
                        'update' => __('Update'),
1440
 
                        'savePending' => __('Save as Pending'),
1441
 
                        'saveDraft' => __('Save Draft'),
1442
 
                        'private' => __('Private'),
1443
 
                        'public' => __('Public'),
1444
 
                        'publicSticky' => __('Public, Sticky'),
1445
 
                        'password' => __('Password Protected'),
1446
 
                        'privatelyPublished' => __('Privately Published'),
1447
 
                        'published' => __('Published'),
1448
 
                        'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
1449
 
                        'savingText' => __('Saving Draft&#8230;'),
1450
 
                        'permalinkSaved' => __( 'Permalink saved' ),
1451
 
                ) );
 
1531
                did_action( 'init' ) && $scripts->localize(
 
1532
                        'post',
 
1533
                        'postL10n',
 
1534
                        array(
 
1535
                                'ok'                 => __( 'OK' ),
 
1536
                                'cancel'             => __( 'Cancel' ),
 
1537
                                'publishOn'          => __( 'Publish on:' ),
 
1538
                                'publishOnFuture'    => __( 'Schedule for:' ),
 
1539
                                'publishOnPast'      => __( 'Published on:' ),
 
1540
                                /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
 
1541
                                'dateFormat'         => __( '%1$s %2$s, %3$s @ %4$s:%5$s' ),
 
1542
                                'showcomm'           => __( 'Show more comments' ),
 
1543
                                'endcomm'            => __( 'No more comments found.' ),
 
1544
                                'publish'            => __( 'Publish' ),
 
1545
                                'schedule'           => _x( 'Schedule', 'post action/button label' ),
 
1546
                                'update'             => __( 'Update' ),
 
1547
                                'savePending'        => __( 'Save as Pending' ),
 
1548
                                'saveDraft'          => __( 'Save Draft' ),
 
1549
                                'private'            => __( 'Private' ),
 
1550
                                'public'             => __( 'Public' ),
 
1551
                                'publicSticky'       => __( 'Public, Sticky' ),
 
1552
                                'password'           => __( 'Password Protected' ),
 
1553
                                'privatelyPublished' => __( 'Privately Published' ),
 
1554
                                'published'          => __( 'Published' ),
 
1555
                                'saveAlert'          => __( 'The changes you made will be lost if you navigate away from this page.' ),
 
1556
                                'savingText'         => __( 'Saving Draft&#8230;' ),
 
1557
                                'permalinkSaved'     => __( 'Permalink saved' ),
 
1558
                        )
 
1559
                );
1452
1560
 
1453
1561
                $scripts->add( 'editor-expand', "/wp-admin/js/editor-expand$suffix.js", array( 'jquery', 'underscore' ), false, 1 );
1454
1562
 
1456
1564
 
1457
1565
                $scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array( 'jquery', 'postbox' ) );
1458
1566
                $scripts->add_data( 'comment', 'group', 1 );
1459
 
                did_action( 'init' ) && $scripts->localize( 'comment', 'commentL10n', array(
1460
 
                        'submittedOn' => __( 'Submitted on:' ),
1461
 
                        /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
1462
 
                        'dateFormat' => __( '%1$s %2$s, %3$s @ %4$s:%5$s' )
1463
 
                ) );
 
1567
                did_action( 'init' ) && $scripts->localize(
 
1568
                        'comment',
 
1569
                        'commentL10n',
 
1570
                        array(
 
1571
                                'submittedOn' => __( 'Submitted on:' ),
 
1572
                                /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
 
1573
                                'dateFormat'  => __( '%1$s %2$s, %3$s @ %4$s:%5$s' ),
 
1574
                        )
 
1575
                );
1464
1576
 
1465
1577
                $scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ) );
1466
1578
 
1467
1579
                $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), false, 1 );
1468
 
                did_action( 'init' ) && $scripts->add_inline_script( 'admin-widgets', sprintf( 'wpWidgets.l10n = %s;', wp_json_encode( array(
1469
 
                        'save' => __( 'Save' ),
1470
 
                        'saved' => __( 'Saved' ),
1471
 
                        'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
1472
 
                ) ) ) );
 
1580
                did_action( 'init' ) && $scripts->add_inline_script(
 
1581
                        'admin-widgets',
 
1582
                        sprintf(
 
1583
                                'wpWidgets.l10n = %s;',
 
1584
                                wp_json_encode(
 
1585
                                        array(
 
1586
                                                'save'      => __( 'Save' ),
 
1587
                                                'saved'     => __( 'Saved' ),
 
1588
                                                'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
 
1589
                                        )
 
1590
                                )
 
1591
                        )
 
1592
                );
1473
1593
 
1474
1594
                $scripts->add( 'media-widgets', "/wp-admin/js/widgets/media-widgets$suffix.js", array( 'jquery', 'media-models', 'media-views', 'wp-api-request' ) );
1475
1595
                $scripts->add_inline_script( 'media-widgets', 'wp.mediaWidgets.init();', 'after' );
1484
1604
                $scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'wp-backbone', 'wp-a11y', 'customize-base' ), false, 1 );
1485
1605
 
1486
1606
                $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'tags-suggest', 'wp-a11y' ), false, 1 );
1487
 
                did_action( 'init' ) && $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
1488
 
                        'error'      => __( 'Error while saving the changes.' ),
1489
 
                        'ntdeltitle' => __( 'Remove From Bulk Edit' ),
1490
 
                        'notitle'    => __( '(no title)' ),
1491
 
                        'comma'      => trim( _x( ',', 'tag delimiter' ) ),
1492
 
                        'saved'      => __( 'Changes saved.' ),
1493
 
                ) );
 
1607
                did_action( 'init' ) && $scripts->localize(
 
1608
                        'inline-edit-post',
 
1609
                        'inlineEditL10n',
 
1610
                        array(
 
1611
                                'error'      => __( 'Error while saving the changes.' ),
 
1612
                                'ntdeltitle' => __( 'Remove From Bulk Edit' ),
 
1613
                                'notitle'    => __( '(no title)' ),
 
1614
                                'comma'      => trim( _x( ',', 'tag delimiter' ) ),
 
1615
                                'saved'      => __( 'Changes saved.' ),
 
1616
                        )
 
1617
                );
1494
1618
 
1495
1619
                $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
1496
 
                did_action( 'init' ) && $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
1497
 
                        'error' => __( 'Error while saving the changes.' ),
1498
 
                        'saved' => __( 'Changes saved.' ),
1499
 
                ) );
 
1620
                did_action( 'init' ) && $scripts->localize(
 
1621
                        'inline-edit-tax',
 
1622
                        'inlineEditL10n',
 
1623
                        array(
 
1624
                                'error' => __( 'Error while saving the changes.' ),
 
1625
                                'saved' => __( 'Changes saved.' ),
 
1626
                        )
 
1627
                );
1500
1628
 
1501
1629
                $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'jquery-ui-core', 'thickbox' ), false, 1 );
1502
 
                did_action( 'init' ) && $scripts->localize( 'plugin-install', 'plugininstallL10n', array(
1503
 
                        'plugin_information' => __( 'Plugin:' ),
1504
 
                        'plugin_modal_label' => __( 'Plugin details' ),
1505
 
                        'ays' => __('Are you sure you want to install this plugin?')
1506
 
                ) );
 
1630
                did_action( 'init' ) && $scripts->localize(
 
1631
                        'plugin-install',
 
1632
                        'plugininstallL10n',
 
1633
                        array(
 
1634
                                'plugin_information' => __( 'Plugin:' ),
 
1635
                                'plugin_modal_label' => __( 'Plugin details' ),
 
1636
                                'ays'                => __( 'Are you sure you want to install this plugin?' ),
 
1637
                        )
 
1638
                );
1507
1639
 
1508
1640
                $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y' ), false, 1 );
1509
 
                did_action( 'init' ) && $scripts->localize( 'updates', '_wpUpdatesSettings', array(
1510
 
                        'ajax_nonce' => wp_create_nonce( 'updates' ),
1511
 
                        'l10n'       => array(
1512
 
                                /* translators: %s: Search string */
1513
 
                                'searchResults'              => __( 'Search results for &#8220;%s&#8221;' ),
1514
 
                                'searchResultsLabel'         => __( 'Search Results' ),
1515
 
                                'noPlugins'                  => __( 'You do not appear to have any plugins available at this time.' ),
1516
 
                                'noItemsSelected'            => __( 'Please select at least one item to perform this action on.' ),
1517
 
                                'updating'                   => __( 'Updating...' ), // No ellipsis.
1518
 
                                'pluginUpdated'              => _x( 'Updated!', 'plugin' ),
1519
 
                                'themeUpdated'               => _x( 'Updated!', 'theme' ),
1520
 
                                'update'                     => __( 'Update' ),
1521
 
                                'updateNow'                  => __( 'Update Now' ),
1522
 
                                /* translators: %s: Plugin name and version */
1523
 
                                'pluginUpdateNowLabel'       => _x( 'Update %s now', 'plugin' ),
1524
 
                                'updateFailedShort'          => __( 'Update Failed!' ),
1525
 
                                /* translators: %s: Error string for a failed update */
1526
 
                                'updateFailed'               => __( 'Update Failed: %s' ),
1527
 
                                /* translators: %s: Plugin name and version */
1528
 
                                'pluginUpdatingLabel'        => _x( 'Updating %s...', 'plugin' ), // No ellipsis.
1529
 
                                /* translators: %s: Plugin name and version */
1530
 
                                'pluginUpdatedLabel'         => _x( '%s updated!', 'plugin' ),
1531
 
                                /* translators: %s: Plugin name and version */
1532
 
                                'pluginUpdateFailedLabel'    => _x( '%s update failed', 'plugin' ),
1533
 
                                /* translators: Accessibility text */
1534
 
                                'updatingMsg'                => __( 'Updating... please wait.' ), // No ellipsis.
1535
 
                                /* translators: Accessibility text */
1536
 
                                'updatedMsg'                 => __( 'Update completed successfully.' ),
1537
 
                                /* translators: Accessibility text */
1538
 
                                'updateCancel'               => __( 'Update canceled.' ),
1539
 
                                'beforeunload'               => __( 'Updates may not complete if you navigate away from this page.' ),
1540
 
                                'installNow'                 => __( 'Install Now' ),
1541
 
                                /* translators: %s: Plugin name */
1542
 
                                'pluginInstallNowLabel'      => _x( 'Install %s now', 'plugin' ),
1543
 
                                'installing'                 => __( 'Installing...' ),
1544
 
                                'pluginInstalled'            => _x( 'Installed!', 'plugin' ),
1545
 
                                'themeInstalled'             => _x( 'Installed!', 'theme' ),
1546
 
                                'installFailedShort'         => __( 'Installation Failed!' ),
1547
 
                                /* translators: %s: Error string for a failed installation */
1548
 
                                'installFailed'              => __( 'Installation failed: %s' ),
1549
 
                                /* translators: %s: Plugin name and version */
1550
 
                                'pluginInstallingLabel'      => _x( 'Installing %s...', 'plugin' ), // no ellipsis
1551
 
                                /* translators: %s: Theme name and version */
1552
 
                                'themeInstallingLabel'       => _x( 'Installing %s...', 'theme' ), // no ellipsis
1553
 
                                /* translators: %s: Plugin name and version */
1554
 
                                'pluginInstalledLabel'       => _x( '%s installed!', 'plugin' ),
1555
 
                                /* translators: %s: Theme name and version */
1556
 
                                'themeInstalledLabel'        => _x( '%s installed!', 'theme' ),
1557
 
                                /* translators: %s: Plugin name and version */
1558
 
                                'pluginInstallFailedLabel'   => _x( '%s installation failed', 'plugin' ),
1559
 
                                /* translators: %s: Theme name and version */
1560
 
                                'themeInstallFailedLabel'    => _x( '%s installation failed', 'theme' ),
1561
 
                                'installingMsg'              => __( 'Installing... please wait.' ),
1562
 
                                'installedMsg'               => __( 'Installation completed successfully.' ),
1563
 
                                /* translators: %s: Activation URL */
1564
 
                                'importerInstalledMsg'       => __( 'Importer installed successfully. <a href="%s">Run importer</a>' ),
1565
 
                                /* translators: %s: Theme name */
1566
 
                                'aysDelete'                  => __( 'Are you sure you want to delete %s?' ),
1567
 
                                /* translators: %s: Plugin name */
1568
 
                                'aysDeleteUninstall'         => __( 'Are you sure you want to delete %s and its data?' ),
1569
 
                                'aysBulkDelete'              => __( 'Are you sure you want to delete the selected plugins and their data?' ),
1570
 
                                'aysBulkDeleteThemes'        => __( 'Caution: These themes may be active on other sites in the network. Are you sure you want to proceed?' ),
1571
 
                                'deleting'                   => __( 'Deleting...' ),
1572
 
                                /* translators: %s: Error string for a failed deletion */
1573
 
                                'deleteFailed'               => __( 'Deletion failed: %s' ),
1574
 
                                'pluginDeleted'              => _x( 'Deleted!', 'plugin' ),
1575
 
                                'themeDeleted'               => _x( 'Deleted!', 'theme' ),
1576
 
                                'livePreview'                => __( 'Live Preview' ),
1577
 
                                'activatePlugin'             => is_network_admin() ? __( 'Network Activate' ) : __( 'Activate' ),
1578
 
                                'activateTheme'              => is_network_admin() ? __( 'Network Enable' ) : __( 'Activate' ),
1579
 
                                /* translators: %s: Plugin name */
1580
 
                                'activatePluginLabel'        => is_network_admin() ? _x( 'Network Activate %s', 'plugin' ) : _x( 'Activate %s', 'plugin' ),
1581
 
                                /* translators: %s: Theme name */
1582
 
                                'activateThemeLabel'         => is_network_admin() ? _x( 'Network Activate %s', 'theme' ) : _x( 'Activate %s', 'theme' ),
1583
 
                                'activateImporter'           => __( 'Run Importer' ),
1584
 
                                /* translators: %s: Importer name */
1585
 
                                'activateImporterLabel'      => __( 'Run %s' ),
1586
 
                                'unknownError'               => __( 'Something went wrong.' ),
1587
 
                                'connectionError'            => __( 'Connection lost or the server is busy. Please try again later.' ),
1588
 
                                'nonceError'                 => __( 'An error has occurred. Please reload the page and try again.' ),
1589
 
                                'pluginsFound'               => __( 'Number of plugins found: %d' ),
1590
 
                                'noPluginsFound'             => __( 'No plugins found. Try a different search.' ),
1591
 
                        ),
1592
 
                ) );
 
1641
                did_action( 'init' ) && $scripts->localize(
 
1642
                        'updates',
 
1643
                        '_wpUpdatesSettings',
 
1644
                        array(
 
1645
                                'ajax_nonce' => wp_create_nonce( 'updates' ),
 
1646
                                'l10n'       => array(
 
1647
                                        /* translators: %s: Search string */
 
1648
                                        'searchResults'            => __( 'Search results for &#8220;%s&#8221;' ),
 
1649
                                        'searchResultsLabel'       => __( 'Search Results' ),
 
1650
                                        'noPlugins'                => __( 'You do not appear to have any plugins available at this time.' ),
 
1651
                                        'noItemsSelected'          => __( 'Please select at least one item to perform this action on.' ),
 
1652
                                        'updating'                 => __( 'Updating...' ), // No ellipsis.
 
1653
                                        'pluginUpdated'            => _x( 'Updated!', 'plugin' ),
 
1654
                                        'themeUpdated'             => _x( 'Updated!', 'theme' ),
 
1655
                                        'update'                   => __( 'Update' ),
 
1656
                                        'updateNow'                => __( 'Update Now' ),
 
1657
                                        /* translators: %s: Plugin name and version */
 
1658
                                        'pluginUpdateNowLabel'     => _x( 'Update %s now', 'plugin' ),
 
1659
                                        'updateFailedShort'        => __( 'Update Failed!' ),
 
1660
                                        /* translators: %s: Error string for a failed update */
 
1661
                                        'updateFailed'             => __( 'Update Failed: %s' ),
 
1662
                                        /* translators: %s: Plugin name and version */
 
1663
                                        'pluginUpdatingLabel'      => _x( 'Updating %s...', 'plugin' ), // No ellipsis.
 
1664
                                        /* translators: %s: Plugin name and version */
 
1665
                                        'pluginUpdatedLabel'       => _x( '%s updated!', 'plugin' ),
 
1666
                                        /* translators: %s: Plugin name and version */
 
1667
                                        'pluginUpdateFailedLabel'  => _x( '%s update failed', 'plugin' ),
 
1668
                                        /* translators: Accessibility text */
 
1669
                                        'updatingMsg'              => __( 'Updating... please wait.' ), // No ellipsis.
 
1670
                                        /* translators: Accessibility text */
 
1671
                                        'updatedMsg'               => __( 'Update completed successfully.' ),
 
1672
                                        /* translators: Accessibility text */
 
1673
                                        'updateCancel'             => __( 'Update canceled.' ),
 
1674
                                        'beforeunload'             => __( 'Updates may not complete if you navigate away from this page.' ),
 
1675
                                        'installNow'               => __( 'Install Now' ),
 
1676
                                        /* translators: %s: Plugin name */
 
1677
                                        'pluginInstallNowLabel'    => _x( 'Install %s now', 'plugin' ),
 
1678
                                        'installing'               => __( 'Installing...' ),
 
1679
                                        'pluginInstalled'          => _x( 'Installed!', 'plugin' ),
 
1680
                                        'themeInstalled'           => _x( 'Installed!', 'theme' ),
 
1681
                                        'installFailedShort'       => __( 'Installation Failed!' ),
 
1682
                                        /* translators: %s: Error string for a failed installation */
 
1683
                                        'installFailed'            => __( 'Installation failed: %s' ),
 
1684
                                        /* translators: %s: Plugin name and version */
 
1685
                                        'pluginInstallingLabel'    => _x( 'Installing %s...', 'plugin' ), // no ellipsis
 
1686
                                        /* translators: %s: Theme name and version */
 
1687
                                        'themeInstallingLabel'     => _x( 'Installing %s...', 'theme' ), // no ellipsis
 
1688
                                        /* translators: %s: Plugin name and version */
 
1689
                                        'pluginInstalledLabel'     => _x( '%s installed!', 'plugin' ),
 
1690
                                        /* translators: %s: Theme name and version */
 
1691
                                        'themeInstalledLabel'      => _x( '%s installed!', 'theme' ),
 
1692
                                        /* translators: %s: Plugin name and version */
 
1693
                                        'pluginInstallFailedLabel' => _x( '%s installation failed', 'plugin' ),
 
1694
                                        /* translators: %s: Theme name and version */
 
1695
                                        'themeInstallFailedLabel'  => _x( '%s installation failed', 'theme' ),
 
1696
                                        'installingMsg'            => __( 'Installing... please wait.' ),
 
1697
                                        'installedMsg'             => __( 'Installation completed successfully.' ),
 
1698
                                        /* translators: %s: Activation URL */
 
1699
                                        'importerInstalledMsg'     => __( 'Importer installed successfully. <a href="%s">Run importer</a>' ),
 
1700
                                        /* translators: %s: Theme name */
 
1701
                                        'aysDelete'                => __( 'Are you sure you want to delete %s?' ),
 
1702
                                        /* translators: %s: Plugin name */
 
1703
                                        'aysDeleteUninstall'       => __( 'Are you sure you want to delete %s and its data?' ),
 
1704
                                        'aysBulkDelete'            => __( 'Are you sure you want to delete the selected plugins and their data?' ),
 
1705
                                        'aysBulkDeleteThemes'      => __( 'Caution: These themes may be active on other sites in the network. Are you sure you want to proceed?' ),
 
1706
                                        'deleting'                 => __( 'Deleting...' ),
 
1707
                                        /* translators: %s: Error string for a failed deletion */
 
1708
                                        'deleteFailed'             => __( 'Deletion failed: %s' ),
 
1709
                                        'pluginDeleted'            => _x( 'Deleted!', 'plugin' ),
 
1710
                                        'themeDeleted'             => _x( 'Deleted!', 'theme' ),
 
1711
                                        'livePreview'              => __( 'Live Preview' ),
 
1712
                                        'activatePlugin'           => is_network_admin() ? __( 'Network Activate' ) : __( 'Activate' ),
 
1713
                                        'activateTheme'            => is_network_admin() ? __( 'Network Enable' ) : __( 'Activate' ),
 
1714
                                        /* translators: %s: Plugin name */
 
1715
                                        'activatePluginLabel'      => is_network_admin() ? _x( 'Network Activate %s', 'plugin' ) : _x( 'Activate %s', 'plugin' ),
 
1716
                                        /* translators: %s: Theme name */
 
1717
                                        'activateThemeLabel'       => is_network_admin() ? _x( 'Network Activate %s', 'theme' ) : _x( 'Activate %s', 'theme' ),
 
1718
                                        'activateImporter'         => __( 'Run Importer' ),
 
1719
                                        /* translators: %s: Importer name */
 
1720
                                        'activateImporterLabel'    => __( 'Run %s' ),
 
1721
                                        'unknownError'             => __( 'Something went wrong.' ),
 
1722
                                        'connectionError'          => __( 'Connection lost or the server is busy. Please try again later.' ),
 
1723
                                        'nonceError'               => __( 'An error has occurred. Please reload the page and try again.' ),
 
1724
                                        'pluginsFound'             => __( 'Number of plugins found: %d' ),
 
1725
                                        'noPluginsFound'           => __( 'No plugins found. Try a different search.' ),
 
1726
                                ),
 
1727
                        )
 
1728
                );
1593
1729
 
1594
 
                $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );
 
1730
                $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array( 'jquery' ), '1.2' );
1595
1731
 
1596
1732
                $scripts->add( 'iris', '/wp-admin/js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), '1.0.7', 1 );
1597
1733
                $scripts->add( 'wp-color-picker', "/wp-admin/js/color-picker$suffix.js", array( 'iris' ), false, 1 );
1598
 
                did_action( 'init' ) && $scripts->localize( 'wp-color-picker', 'wpColorPickerL10n', array(
1599
 
                        'clear'            => __( 'Clear' ),
1600
 
                        'clearAriaLabel'   => __( 'Clear color' ),
1601
 
                        'defaultString'    => __( 'Default' ),
1602
 
                        'defaultAriaLabel' => __( 'Select default color' ),
1603
 
                        'pick'             => __( 'Select Color' ),
1604
 
                        'defaultLabel'     => __( 'Color value' ),
1605
 
                ) );
 
1734
                did_action( 'init' ) && $scripts->localize(
 
1735
                        'wp-color-picker',
 
1736
                        'wpColorPickerL10n',
 
1737
                        array(
 
1738
                                'clear'            => __( 'Clear' ),
 
1739
                                'clearAriaLabel'   => __( 'Clear color' ),
 
1740
                                'defaultString'    => __( 'Default' ),
 
1741
                                'defaultAriaLabel' => __( 'Select default color' ),
 
1742
                                'pick'             => __( 'Select Color' ),
 
1743
                                'defaultLabel'     => __( 'Color value' ),
 
1744
                        )
 
1745
                );
1606
1746
 
1607
1747
                $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox', 'wp-util', 'wp-a11y' ), false, 1 );
1608
1748
 
1610
1750
 
1611
1751
                $scripts->add( 'media-grid', "/wp-includes/js/media-grid$suffix.js", array( 'media-editor' ), false, 1 );
1612
1752
                $scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery' ), false, 1 );
1613
 
                did_action( 'init' ) && $scripts->localize( 'media', 'attachMediaBoxL10n', array(
1614
 
                        'error' => __( 'An error has occurred. Please reload the page and try again.' ),
1615
 
                ));
 
1753
                did_action( 'init' ) && $scripts->localize(
 
1754
                        'media',
 
1755
                        'attachMediaBoxL10n',
 
1756
                        array(
 
1757
                                'error' => __( 'An error has occurred. Please reload the page and try again.' ),
 
1758
                        )
 
1759
                );
1616
1760
 
1617
 
                $scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), false, 1 );
1618
 
                did_action( 'init' ) && $scripts->localize( 'image-edit', 'imageEditL10n', array(
1619
 
                        'error' => __( 'Could not load the preview image. Please reload the page and try again.' )
1620
 
                ));
 
1761
                $scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array( 'jquery', 'json2', 'imgareaselect' ), false, 1 );
 
1762
                did_action( 'init' ) && $scripts->localize(
 
1763
                        'image-edit',
 
1764
                        'imageEditL10n',
 
1765
                        array(
 
1766
                                'error' => __( 'Could not load the preview image. Please reload the page and try again.' ),
 
1767
                        )
 
1768
                );
1621
1769
 
1622
1770
                $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 );
1623
 
                did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
1624
 
                        'setThumbnail' => __( 'Use as featured image' ),
1625
 
                        'saving' => __( 'Saving...' ), // no ellipsis
1626
 
                        'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ),
1627
 
                        'done' => __( 'Done' )
1628
 
                ) );
1629
 
 
1630
 
                // Navigation Menus
1631
 
                $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-lists', 'postbox', 'json2' ) );
1632
 
                did_action( 'init' ) && $scripts->localize( 'nav-menu', 'navMenuL10n', array(
1633
 
                        'noResultsFound' => __( 'No results found.' ),
1634
 
                        'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
1635
 
                        'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
1636
 
                        'untitled' => _x( '(no label)', 'missing menu item navigation label' )
1637
 
                ) );
1638
 
 
1639
 
                $scripts->add( 'custom-header', "/wp-admin/js/custom-header.js", array( 'jquery-masonry' ), false, 1 );
 
1771
                did_action( 'init' ) && $scripts->localize(
 
1772
                        'set-post-thumbnail',
 
1773
                        'setPostThumbnailL10n',
 
1774
                        array(
 
1775
                                'setThumbnail' => __( 'Use as featured image' ),
 
1776
                                'saving'       => __( 'Saving...' ), // no ellipsis
 
1777
                                'error'        => __( 'Could not set that as the thumbnail image. Try a different attachment.' ),
 
1778
                                'done'         => __( 'Done' ),
 
1779
                        )
 
1780
                );
 
1781
 
 
1782
                /*
 
1783
                 * Navigation Menus: Adding underscore as a dependency to utilize _.debounce
 
1784
                 * see https://core.trac.wordpress.org/ticket/42321
 
1785
                 */
 
1786
                $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-lists', 'postbox', 'json2', 'underscore' ) );
 
1787
                did_action( 'init' ) && $scripts->localize(
 
1788
                        'nav-menu',
 
1789
                        'navMenuL10n',
 
1790
                        array(
 
1791
                                'noResultsFound' => __( 'No results found.' ),
 
1792
                                'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
 
1793
                                'saveAlert'      => __( 'The changes you made will be lost if you navigate away from this page.' ),
 
1794
                                'untitled'       => _x( '(no label)', 'missing menu item navigation label' ),
 
1795
                        )
 
1796
                );
 
1797
 
 
1798
                $scripts->add( 'custom-header', '/wp-admin/js/custom-header.js', array( 'jquery-masonry' ), false, 1 );
1640
1799
                $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array( 'wp-color-picker', 'media-views' ), false, 1 );
1641
 
                $scripts->add( 'media-gallery', "/wp-admin/js/media-gallery$suffix.js", array('jquery'), false, 1 );
 
1800
                $scripts->add( 'media-gallery', "/wp-admin/js/media-gallery$suffix.js", array( 'jquery' ), false, 1 );
1642
1801
 
1643
1802
                $scripts->add( 'svg-painter', '/wp-admin/js/svg-painter.js', array( 'jquery' ), false, 1 );
1644
1803
        }
1662
1821
function wp_default_styles( &$styles ) {
1663
1822
        include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
1664
1823
 
1665
 
        if ( ! defined( 'SCRIPT_DEBUG' ) )
 
1824
        if ( ! defined( 'SCRIPT_DEBUG' ) ) {
1666
1825
                define( 'SCRIPT_DEBUG', false !== strpos( $wp_version, '-src' ) );
 
1826
        }
1667
1827
 
1668
 
        if ( ! $guessurl = site_url() )
 
1828
        if ( ! $guessurl = site_url() ) {
1669
1829
                $guessurl = wp_guess_url();
 
1830
        }
1670
1831
 
1671
 
        $styles->base_url = $guessurl;
1672
 
        $styles->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';
 
1832
        $styles->base_url        = $guessurl;
 
1833
        $styles->content_url     = defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL : '';
1673
1834
        $styles->default_version = get_bloginfo( 'version' );
1674
 
        $styles->text_direction = function_exists( 'is_rtl' ) && is_rtl() ? 'rtl' : 'ltr';
1675
 
        $styles->default_dirs = array('/wp-admin/', '/wp-includes/css/');
 
1835
        $styles->text_direction  = function_exists( 'is_rtl' ) && is_rtl() ? 'rtl' : 'ltr';
 
1836
        $styles->default_dirs    = array( '/wp-admin/', '/wp-includes/css/' );
1676
1837
 
1677
1838
        // Open Sans is no longer used by core, but may be relied upon by themes and plugins.
1678
1839
        $open_sans_font_url = '';
1706
1867
        $suffix = SCRIPT_DEBUG ? '' : '.min';
1707
1868
 
1708
1869
        // Admin CSS
1709
 
        $styles->add( 'common',              "/wp-admin/css/common$suffix.css" );
1710
 
        $styles->add( 'forms',               "/wp-admin/css/forms$suffix.css" );
1711
 
        $styles->add( 'admin-menu',          "/wp-admin/css/admin-menu$suffix.css" );
1712
 
        $styles->add( 'dashboard',           "/wp-admin/css/dashboard$suffix.css" );
1713
 
        $styles->add( 'list-tables',         "/wp-admin/css/list-tables$suffix.css" );
1714
 
        $styles->add( 'edit',                "/wp-admin/css/edit$suffix.css" );
1715
 
        $styles->add( 'revisions',           "/wp-admin/css/revisions$suffix.css" );
1716
 
        $styles->add( 'media',               "/wp-admin/css/media$suffix.css" );
1717
 
        $styles->add( 'themes',              "/wp-admin/css/themes$suffix.css" );
1718
 
        $styles->add( 'about',               "/wp-admin/css/about$suffix.css" );
1719
 
        $styles->add( 'nav-menus',           "/wp-admin/css/nav-menus$suffix.css" );
1720
 
        $styles->add( 'widgets',             "/wp-admin/css/widgets$suffix.css", array( 'wp-pointer' ) );
1721
 
        $styles->add( 'site-icon',           "/wp-admin/css/site-icon$suffix.css" );
1722
 
        $styles->add( 'l10n',                "/wp-admin/css/l10n$suffix.css" );
1723
 
        $styles->add( 'code-editor',         "/wp-admin/css/code-editor$suffix.css", array( 'wp-codemirror' ) );
 
1870
        $styles->add( 'common', "/wp-admin/css/common$suffix.css" );
 
1871
        $styles->add( 'forms', "/wp-admin/css/forms$suffix.css" );
 
1872
        $styles->add( 'admin-menu', "/wp-admin/css/admin-menu$suffix.css" );
 
1873
        $styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css" );
 
1874
        $styles->add( 'list-tables', "/wp-admin/css/list-tables$suffix.css" );
 
1875
        $styles->add( 'edit', "/wp-admin/css/edit$suffix.css" );
 
1876
        $styles->add( 'revisions', "/wp-admin/css/revisions$suffix.css" );
 
1877
        $styles->add( 'media', "/wp-admin/css/media$suffix.css" );
 
1878
        $styles->add( 'themes', "/wp-admin/css/themes$suffix.css" );
 
1879
        $styles->add( 'about', "/wp-admin/css/about$suffix.css" );
 
1880
        $styles->add( 'nav-menus', "/wp-admin/css/nav-menus$suffix.css" );
 
1881
        $styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css", array( 'wp-pointer' ) );
 
1882
        $styles->add( 'site-icon', "/wp-admin/css/site-icon$suffix.css" );
 
1883
        $styles->add( 'l10n', "/wp-admin/css/l10n$suffix.css" );
 
1884
        $styles->add( 'code-editor', "/wp-admin/css/code-editor$suffix.css", array( 'wp-codemirror' ) );
1724
1885
 
1725
1886
        $styles->add( 'wp-admin', false, array( 'dashicons', 'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus', 'widgets', 'site-icon', 'l10n' ) );
1726
1887
 
1727
 
        $styles->add( 'login',               "/wp-admin/css/login$suffix.css", array( 'dashicons', 'buttons', 'forms', 'l10n' ) );
1728
 
        $styles->add( 'install',             "/wp-admin/css/install$suffix.css", array( 'buttons' ) );
1729
 
        $styles->add( 'wp-color-picker',     "/wp-admin/css/color-picker$suffix.css" );
1730
 
        $styles->add( 'customize-controls',  "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie', 'imgareaselect' ) );
1731
 
        $styles->add( 'customize-widgets',   "/wp-admin/css/customize-widgets$suffix.css", array( 'wp-admin', 'colors' ) );
 
1888
        $styles->add( 'login', "/wp-admin/css/login$suffix.css", array( 'dashicons', 'buttons', 'forms', 'l10n' ) );
 
1889
        $styles->add( 'install', "/wp-admin/css/install$suffix.css", array( 'buttons' ) );
 
1890
        $styles->add( 'wp-color-picker', "/wp-admin/css/color-picker$suffix.css" );
 
1891
        $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie', 'imgareaselect' ) );
 
1892
        $styles->add( 'customize-widgets', "/wp-admin/css/customize-widgets$suffix.css", array( 'wp-admin', 'colors' ) );
1732
1893
        $styles->add( 'customize-nav-menus', "/wp-admin/css/customize-nav-menus$suffix.css", array( 'wp-admin', 'colors' ) );
1733
1894
 
1734
1895
        $styles->add( 'ie', "/wp-admin/css/ie$suffix.css" );
1735
1896
        $styles->add_data( 'ie', 'conditional', 'lte IE 7' );
1736
1897
 
1737
1898
        // Common dependencies
1738
 
        $styles->add( 'buttons',   "/wp-includes/css/buttons$suffix.css" );
 
1899
        $styles->add( 'buttons', "/wp-includes/css/buttons$suffix.css" );
1739
1900
        $styles->add( 'dashicons', "/wp-includes/css/dashicons$suffix.css" );
1740
1901
 
1741
1902
        // Includes CSS
1742
 
        $styles->add( 'admin-bar',            "/wp-includes/css/admin-bar$suffix.css", array( 'dashicons' ) );
1743
 
        $styles->add( 'wp-auth-check',        "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons' ) );
1744
 
        $styles->add( 'editor-buttons',       "/wp-includes/css/editor$suffix.css", array( 'dashicons' ) );
1745
 
        $styles->add( 'media-views',          "/wp-includes/css/media-views$suffix.css", array( 'buttons', 'dashicons', 'wp-mediaelement' ) );
1746
 
        $styles->add( 'wp-pointer',           "/wp-includes/css/wp-pointer$suffix.css", array( 'dashicons' ) );
1747
 
        $styles->add( 'customize-preview',    "/wp-includes/css/customize-preview$suffix.css", array( 'dashicons' ) );
 
1903
        $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array( 'dashicons' ) );
 
1904
        $styles->add( 'wp-auth-check', "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons' ) );
 
1905
        $styles->add( 'editor-buttons', "/wp-includes/css/editor$suffix.css", array( 'dashicons' ) );
 
1906
        $styles->add( 'media-views', "/wp-includes/css/media-views$suffix.css", array( 'buttons', 'dashicons', 'wp-mediaelement' ) );
 
1907
        $styles->add( 'wp-pointer', "/wp-includes/css/wp-pointer$suffix.css", array( 'dashicons' ) );
 
1908
        $styles->add( 'customize-preview', "/wp-includes/css/customize-preview$suffix.css", array( 'dashicons' ) );
1748
1909
        $styles->add( 'wp-embed-template-ie', "/wp-includes/css/wp-embed-template-ie$suffix.css" );
1749
1910
        $styles->add_data( 'wp-embed-template-ie', 'conditional', 'lte IE 8' );
1750
1911
 
1751
1912
        // External libraries and friends
1752
 
        $styles->add( 'imgareaselect',       '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' );
 
1913
        $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' );
1753
1914
        $styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array( 'dashicons' ) );
1754
 
        $styles->add( 'mediaelement',        "/wp-includes/js/mediaelement/mediaelementplayer-legacy.min.css", array(), '4.2.6-78496d1' );
1755
 
        $styles->add( 'wp-mediaelement',     "/wp-includes/js/mediaelement/wp-mediaelement$suffix.css", array( 'mediaelement' ) );
1756
 
        $styles->add( 'thickbox',            '/wp-includes/js/thickbox/thickbox.css', array( 'dashicons' ) );
1757
 
        $styles->add( 'wp-codemirror',       '/wp-includes/js/codemirror/codemirror.min.css', array(), '5.29.1-alpha-ee20357' );
 
1915
        $styles->add( 'mediaelement', '/wp-includes/js/mediaelement/mediaelementplayer-legacy.min.css', array(), '4.2.6-78496d1' );
 
1916
        $styles->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement$suffix.css", array( 'mediaelement' ) );
 
1917
        $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array( 'dashicons' ) );
 
1918
        $styles->add( 'wp-codemirror', '/wp-includes/js/codemirror/codemirror.min.css', array(), '5.29.1-alpha-ee20357' );
1758
1919
 
1759
1920
        // Deprecated CSS
1760
1921
        $styles->add( 'deprecated-media', "/wp-admin/css/deprecated-media$suffix.css" );
1761
 
        $styles->add( 'farbtastic',       "/wp-admin/css/farbtastic$suffix.css", array(), '1.3u1' );
1762
 
        $styles->add( 'jcrop',            "/wp-includes/js/jcrop/jquery.Jcrop.min.css", array(), '0.9.12' );
 
1922
        $styles->add( 'farbtastic', "/wp-admin/css/farbtastic$suffix.css", array(), '1.3u1' );
 
1923
        $styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.min.css', array(), '0.9.12' );
1763
1924
        $styles->add( 'colors-fresh', false, array( 'wp-admin', 'buttons' ) ); // Old handle.
1764
1925
        $styles->add( 'open-sans', $open_sans_font_url ); // No longer used in core as of 4.6
1765
1926
 
1773
1934
         */
1774
1935
        $font_family = _x( 'Noto Serif:400,400i,700,700i', 'Google Font Name and Variants' );
1775
1936
        if ( 'off' !== $font_family ) {
1776
 
                $fonts_url  =  'https://fonts.googleapis.com/css?family=' . urlencode( $font_family );
 
1937
                $fonts_url = 'https://fonts.googleapis.com/css?family=' . urlencode( $font_family );
1777
1938
        }
1778
1939
        $styles->add( 'wp-editor-font', $fonts_url );
1779
1940
 
1792
1953
        );
1793
1954
 
1794
1955
        $package_styles = array(
1795
 
                'block-library' => array(),
1796
 
                'components' => array(),
1797
 
                'edit-post' => array( 'wp-components', 'wp-editor', 'wp-edit-blocks', 'wp-block-library', 'wp-nux' ),
1798
 
                'editor' => array( 'wp-components', 'wp-editor-font', 'wp-nux' ),
1799
 
                'format-library' => array(),
 
1956
                'block-library'        => array(),
 
1957
                'components'           => array(),
 
1958
                'edit-post'            => array( 'wp-components', 'wp-editor', 'wp-edit-blocks', 'wp-block-library', 'wp-nux' ),
 
1959
                'editor'               => array( 'wp-components', 'wp-editor-font', 'wp-nux' ),
 
1960
                'format-library'       => array(),
1800
1961
                'list-reusable-blocks' => array( 'wp-components' ),
1801
 
                'nux' => array( 'wp-components' ),
 
1962
                'nux'                  => array( 'wp-components' ),
1802
1963
        );
1803
1964
 
1804
1965
        foreach ( $package_styles as $package => $dependencies ) {
1805
 
                $handle  = 'wp-' . $package;
1806
 
                $path    = "/wp-includes/css/dist/$package/style$suffix.css";
 
1966
                $handle = 'wp-' . $package;
 
1967
                $path   = "/wp-includes/css/dist/$package/style$suffix.css";
1807
1968
 
1808
1969
                $styles->add( $handle, $path, $dependencies );
1809
1970
        }
1811
1972
        // RTL CSS
1812
1973
        $rtl_styles = array(
1813
1974
                // Admin CSS
1814
 
                'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus',
1815
 
                'widgets', 'site-icon', 'l10n', 'install', 'wp-color-picker', 'customize-controls', 'customize-widgets', 'customize-nav-menus', 'customize-preview',
1816
 
                'ie', 'login',
 
1975
                'common',
 
1976
                'forms',
 
1977
                'admin-menu',
 
1978
                'dashboard',
 
1979
                'list-tables',
 
1980
                'edit',
 
1981
                'revisions',
 
1982
                'media',
 
1983
                'themes',
 
1984
                'about',
 
1985
                'nav-menus',
 
1986
                'widgets',
 
1987
                'site-icon',
 
1988
                'l10n',
 
1989
                'install',
 
1990
                'wp-color-picker',
 
1991
                'customize-controls',
 
1992
                'customize-widgets',
 
1993
                'customize-nav-menus',
 
1994
                'customize-preview',
 
1995
                'ie',
 
1996
                'login',
1817
1997
                // Includes CSS
1818
 
                'buttons', 'admin-bar', 'wp-auth-check', 'editor-buttons', 'media-views', 'wp-pointer',
 
1998
                'buttons',
 
1999
                'admin-bar',
 
2000
                'wp-auth-check',
 
2001
                'editor-buttons',
 
2002
                'media-views',
 
2003
                'wp-pointer',
1819
2004
                'wp-jquery-ui-dialog',
1820
2005
                // Package styles
1821
 
                'wp-block-library-theme', 'wp-edit-blocks', 'wp-block-library', 'wp-components', 'wp-edit-post', 'wp-editor', 'wp-format-library',
1822
 
                'wp-list-reusable-blocks', 'wp-nux',
 
2006
                'wp-block-library-theme',
 
2007
                'wp-edit-blocks',
 
2008
                'wp-block-library',
 
2009
                'wp-components',
 
2010
                'wp-edit-post',
 
2011
                'wp-editor',
 
2012
                'wp-format-library',
 
2013
                'wp-list-reusable-blocks',
 
2014
                'wp-nux',
1823
2015
                // Deprecated CSS
1824
 
                'deprecated-media', 'farbtastic',
 
2016
                'deprecated-media',
 
2017
                'farbtastic',
1825
2018
        );
1826
2019
 
1827
2020
        foreach ( $rtl_styles as $rtl_style ) {
1841
2034
 * @return array Reordered array, if needed.
1842
2035
 */
1843
2036
function wp_prototype_before_jquery( $js_array ) {
1844
 
        if ( false === $prototype = array_search( 'prototype', $js_array, true ) )
1845
 
                return $js_array;
1846
 
 
1847
 
        if ( false === $jquery = array_search( 'jquery', $js_array, true ) )
1848
 
                return $js_array;
1849
 
 
1850
 
        if ( $prototype < $jquery )
1851
 
                return $js_array;
1852
 
 
1853
 
        unset($js_array[$prototype]);
 
2037
        if ( false === $prototype = array_search( 'prototype', $js_array, true ) ) {
 
2038
                return $js_array;
 
2039
        }
 
2040
 
 
2041
        if ( false === $jquery = array_search( 'jquery', $js_array, true ) ) {
 
2042
                return $js_array;
 
2043
        }
 
2044
 
 
2045
        if ( $prototype < $jquery ) {
 
2046
                return $js_array;
 
2047
        }
 
2048
 
 
2049
        unset( $js_array[ $prototype ] );
1854
2050
 
1855
2051
        array_splice( $js_array, $jquery, 0, 'prototype' );
1856
2052
 
1866
2062
 */
1867
2063
function wp_just_in_time_script_localization() {
1868
2064
 
1869
 
        wp_localize_script( 'autosave', 'autosaveL10n', array(
1870
 
                'autosaveInterval' => AUTOSAVE_INTERVAL,
1871
 
                'blog_id' => get_current_blog_id(),
1872
 
        ) );
1873
 
 
1874
 
        wp_localize_script( 'mce-view', 'mceViewL10n', array(
1875
 
                'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array()
1876
 
        ) );
1877
 
 
1878
 
        wp_localize_script( 'word-count', 'wordCountL10n', array(
1879
 
                /*
1880
 
                 * translators: If your word count is based on single characters (e.g. East Asian characters),
1881
 
                 * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
1882
 
                 * Do not translate into your own language.
1883
 
                 */
1884
 
                'type' => _x( 'words', 'Word count type. Do not translate!' ),
1885
 
                'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array()
1886
 
        ) );
 
2065
        wp_localize_script(
 
2066
                'autosave',
 
2067
                'autosaveL10n',
 
2068
                array(
 
2069
                        'autosaveInterval' => AUTOSAVE_INTERVAL,
 
2070
                        'blog_id'          => get_current_blog_id(),
 
2071
                )
 
2072
        );
 
2073
 
 
2074
        wp_localize_script(
 
2075
                'mce-view',
 
2076
                'mceViewL10n',
 
2077
                array(
 
2078
                        'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array(),
 
2079
                )
 
2080
        );
 
2081
 
 
2082
        wp_localize_script(
 
2083
                'word-count',
 
2084
                'wordCountL10n',
 
2085
                array(
 
2086
                        /*
 
2087
                         * translators: If your word count is based on single characters (e.g. East Asian characters),
 
2088
                         * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
 
2089
                         * Do not translate into your own language.
 
2090
                         */
 
2091
                        'type'       => _x( 'words', 'Word count type. Do not translate!' ),
 
2092
                        'shortcodes' => ! empty( $GLOBALS['shortcode_tags'] ) ? array_keys( $GLOBALS['shortcode_tags'] ) : array(),
 
2093
                )
 
2094
        );
1887
2095
}
1888
2096
 
1889
2097
/**
1905
2113
        // Convert the PHP date format into jQuery UI's format.
1906
2114
        $datepicker_date_format = str_replace(
1907
2115
                array(
1908
 
                        'd', 'j', 'l', 'z', // Day.
1909
 
                        'F', 'M', 'n', 'm', // Month.
1910
 
                        'Y', 'y'            // Year.
 
2116
                        'd',
 
2117
                        'j',
 
2118
                        'l',
 
2119
                        'z', // Day.
 
2120
                        'F',
 
2121
                        'M',
 
2122
                        'n',
 
2123
                        'm', // Month.
 
2124
                        'Y',
 
2125
                        'y',            // Year.
1911
2126
                ),
1912
2127
                array(
1913
 
                        'dd', 'd', 'DD', 'o',
1914
 
                        'MM', 'M', 'm', 'mm',
1915
 
                        'yy', 'y'
 
2128
                        'dd',
 
2129
                        'd',
 
2130
                        'DD',
 
2131
                        'o',
 
2132
                        'MM',
 
2133
                        'M',
 
2134
                        'm',
 
2135
                        'mm',
 
2136
                        'yy',
 
2137
                        'y',
1916
2138
                ),
1917
2139
                get_option( 'date_format' )
1918
2140
        );
1919
2141
 
1920
 
        $datepicker_defaults = wp_json_encode( array(
1921
 
                'closeText'       => __( 'Close' ),
1922
 
                'currentText'     => __( 'Today' ),
1923
 
                'monthNames'      => array_values( $wp_locale->month ),
1924
 
                'monthNamesShort' => array_values( $wp_locale->month_abbrev ),
1925
 
                'nextText'        => __( 'Next' ),
1926
 
                'prevText'        => __( 'Previous' ),
1927
 
                'dayNames'        => array_values( $wp_locale->weekday ),
1928
 
                'dayNamesShort'   => array_values( $wp_locale->weekday_abbrev ),
1929
 
                'dayNamesMin'     => array_values( $wp_locale->weekday_initial ),
1930
 
                'dateFormat'      => $datepicker_date_format,
1931
 
                'firstDay'        => absint( get_option( 'start_of_week' ) ),
1932
 
                'isRTL'           => $wp_locale->is_rtl(),
1933
 
        ) );
 
2142
        $datepicker_defaults = wp_json_encode(
 
2143
                array(
 
2144
                        'closeText'       => __( 'Close' ),
 
2145
                        'currentText'     => __( 'Today' ),
 
2146
                        'monthNames'      => array_values( $wp_locale->month ),
 
2147
                        'monthNamesShort' => array_values( $wp_locale->month_abbrev ),
 
2148
                        'nextText'        => __( 'Next' ),
 
2149
                        'prevText'        => __( 'Previous' ),
 
2150
                        'dayNames'        => array_values( $wp_locale->weekday ),
 
2151
                        'dayNamesShort'   => array_values( $wp_locale->weekday_abbrev ),
 
2152
                        'dayNamesMin'     => array_values( $wp_locale->weekday_initial ),
 
2153
                        'dateFormat'      => $datepicker_date_format,
 
2154
                        'firstDay'        => absint( get_option( 'start_of_week' ) ),
 
2155
                        'isRTL'           => $wp_locale->is_rtl(),
 
2156
                )
 
2157
        );
1934
2158
 
1935
2159
        wp_add_inline_script( 'jquery-ui-datepicker', "jQuery(document).ready(function(jQuery){jQuery.datepicker.setDefaults({$datepicker_defaults});});" );
1936
2160
}
1966
2190
 
1967
2191
        $events_client = new WP_Community_Events( $user_id, $saved_location );
1968
2192
 
1969
 
        wp_localize_script( 'dashboard', 'communityEventsData', array(
1970
 
                'nonce' => wp_create_nonce( 'community_events' ),
1971
 
                'cache' => $events_client->get_cached_events(),
1972
 
 
1973
 
                'l10n' => array(
1974
 
                        'enter_closest_city' => __( 'Enter your closest city to find nearby events.' ),
1975
 
                        'error_occurred_please_try_again' => __( 'An error occurred. Please try again.' ),
1976
 
                        'attend_event_near_generic' => __( 'Attend an upcoming event near you.' ),
1977
 
 
1978
 
                        /*
1979
 
                         * These specific examples were chosen to highlight the fact that a
1980
 
                         * state is not needed, even for cities whose name is not unique.
1981
 
                         * It would be too cumbersome to include that in the instructions
1982
 
                         * to the user, so it's left as an implication.
1983
 
                         */
1984
 
                        /* translators: %s is the name of the city we couldn't locate.
1985
 
                         * Replace the examples with cities related to your locale. Test that
1986
 
                         * they match the expected location and have upcoming events before
1987
 
                         * including them. If no cities related to your locale have events,
1988
 
                         * then use cities related to your locale that would be recognizable
1989
 
                         * to most users. Use only the city name itself, without any region
1990
 
                         * or country. Use the endonym (native locale name) instead of the
1991
 
                         * English name if possible.
1992
 
                         */
1993
 
                        'could_not_locate_city' => __( 'We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ),
1994
 
 
1995
 
                        // This one is only used with wp.a11y.speak(), so it can/should be more brief.
1996
 
                        /* translators: %s: the name of a city */
1997
 
                        'city_updated' => __( 'City updated. Listing events near %s.' ),
 
2193
        wp_localize_script(
 
2194
                'dashboard',
 
2195
                'communityEventsData',
 
2196
                array(
 
2197
                        'nonce' => wp_create_nonce( 'community_events' ),
 
2198
                        'cache' => $events_client->get_cached_events(),
 
2199
 
 
2200
                        'l10n'  => array(
 
2201
                                'enter_closest_city'              => __( 'Enter your closest city to find nearby events.' ),
 
2202
                                'error_occurred_please_try_again' => __( 'An error occurred. Please try again.' ),
 
2203
                                'attend_event_near_generic'       => __( 'Attend an upcoming event near you.' ),
 
2204
 
 
2205
                                /*
 
2206
                                 * These specific examples were chosen to highlight the fact that a
 
2207
                                 * state is not needed, even for cities whose name is not unique.
 
2208
                                 * It would be too cumbersome to include that in the instructions
 
2209
                                 * to the user, so it's left as an implication.
 
2210
                                 */
 
2211
                                /* translators: %s is the name of the city we couldn't locate.
 
2212
                                 * Replace the examples with cities related to your locale. Test that
 
2213
                                 * they match the expected location and have upcoming events before
 
2214
                                 * including them. If no cities related to your locale have events,
 
2215
                                 * then use cities related to your locale that would be recognizable
 
2216
                                 * to most users. Use only the city name itself, without any region
 
2217
                                 * or country. Use the endonym (native locale name) instead of the
 
2218
                                 * English name if possible.
 
2219
                                 */
 
2220
                                'could_not_locate_city'           => __( 'We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.' ),
 
2221
 
 
2222
                                // This one is only used with wp.a11y.speak(), so it can/should be more brief.
 
2223
                                /* translators: %s: the name of a city */
 
2224
                                'city_updated'                    => __( 'City updated. Listing events near %s.' ),
 
2225
                        ),
1998
2226
                )
1999
 
        ) );
 
2227
        );
2000
2228
}
2001
2229
 
2002
2230
/**
2022
2250
function wp_style_loader_src( $src, $handle ) {
2023
2251
        global $_wp_admin_css_colors;
2024
2252
 
2025
 
        if ( wp_installing() )
 
2253
        if ( wp_installing() ) {
2026
2254
                return preg_replace( '#^wp-admin/#', './', $src );
 
2255
        }
2027
2256
 
2028
2257
        if ( 'colors' == $handle ) {
2029
 
                $color = get_user_option('admin_color');
 
2258
                $color = get_user_option( 'admin_color' );
2030
2259
 
2031
 
                if ( empty($color) || !isset($_wp_admin_css_colors[$color]) )
 
2260
                if ( empty( $color ) || ! isset( $_wp_admin_css_colors[ $color ] ) ) {
2032
2261
                        $color = 'fresh';
 
2262
                }
2033
2263
 
2034
 
                $color = $_wp_admin_css_colors[$color];
2035
 
                $url = $color->url;
 
2264
                $color = $_wp_admin_css_colors[ $color ];
 
2265
                $url   = $color->url;
2036
2266
 
2037
2267
                if ( ! $url ) {
2038
2268
                        return false;
2039
2269
                }
2040
2270
 
2041
2271
                $parsed = parse_url( $src );
2042
 
                if ( isset($parsed['query']) && $parsed['query'] ) {
 
2272
                if ( isset( $parsed['query'] ) && $parsed['query'] ) {
2043
2273
                        wp_parse_str( $parsed['query'], $qv );
2044
2274
                        $url = add_query_arg( $qv, $url );
2045
2275
                }
2067
2297
function print_head_scripts() {
2068
2298
        global $concatenate_scripts;
2069
2299
 
2070
 
        if ( ! did_action('wp_print_scripts') ) {
 
2300
        if ( ! did_action( 'wp_print_scripts' ) ) {
2071
2301
                /** This action is documented in wp-includes/functions.wp-scripts.php */
2072
2302
                do_action( 'wp_print_scripts' );
2073
2303
        }
2140
2370
        global $wp_scripts, $compress_scripts;
2141
2371
 
2142
2372
        $zip = $compress_scripts ? 1 : 0;
2143
 
        if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP )
 
2373
        if ( $zip && defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP ) {
2144
2374
                $zip = 'gzip';
 
2375
        }
2145
2376
 
2146
2377
        if ( $concat = trim( $wp_scripts->concat, ', ' ) ) {
2147
2378
 
2148
 
                if ( !empty($wp_scripts->print_code) ) {
 
2379
                if ( ! empty( $wp_scripts->print_code ) ) {
2149
2380
                        echo "\n<script type='text/javascript'>\n";
2150
2381
                        echo "/* <![CDATA[ */\n"; // not needed in HTML 5
2151
2382
                        echo $wp_scripts->print_code;
2157
2388
                $concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );
2158
2389
 
2159
2390
                $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&" . $concat . '&ver=' . $wp_scripts->default_version;
2160
 
                echo "<script type='text/javascript' src='" . esc_attr($src) . "'></script>\n";
 
2391
                echo "<script type='text/javascript' src='" . esc_attr( $src ) . "'></script>\n";
2161
2392
        }
2162
2393
 
2163
 
        if ( !empty($wp_scripts->print_html) )
 
2394
        if ( ! empty( $wp_scripts->print_html ) ) {
2164
2395
                echo $wp_scripts->print_html;
 
2396
        }
2165
2397
}
2166
2398
 
2167
2399
/**
2177
2409
 * @return array
2178
2410
 */
2179
2411
function wp_print_head_scripts() {
2180
 
        if ( ! did_action('wp_print_scripts') ) {
 
2412
        if ( ! did_action( 'wp_print_scripts' ) ) {
2181
2413
                /** This action is documented in wp-includes/functions.wp-scripts.php */
2182
2414
                do_action( 'wp_print_scripts' );
2183
2415
        }
2247
2479
 
2248
2480
        script_concat_settings();
2249
2481
        $wp_styles->do_concat = $concatenate_scripts;
2250
 
        $wp_styles->do_items(false);
 
2482
        $wp_styles->do_items( false );
2251
2483
 
2252
2484
        /**
2253
2485
         * Filters whether to print the admin styles.
2314
2546
        $wp_styles = wp_styles();
2315
2547
 
2316
2548
        $zip = $compress_css ? 1 : 0;
2317
 
        if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP )
 
2549
        if ( $zip && defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP ) {
2318
2550
                $zip = 'gzip';
 
2551
        }
2319
2552
 
2320
2553
        if ( $concat = trim( $wp_styles->concat, ', ' ) ) {
2321
2554
                $dir = $wp_styles->text_direction;
2325
2558
                $concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );
2326
2559
 
2327
2560
                $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&" . $concat . '&ver=' . $ver;
2328
 
                echo "<link rel='stylesheet' href='" . esc_attr($href) . "' type='text/css' media='all' />\n";
 
2561
                echo "<link rel='stylesheet' href='" . esc_attr( $href ) . "' type='text/css' media='all' />\n";
2329
2562
 
2330
 
                if ( !empty($wp_styles->print_code) ) {
 
2563
                if ( ! empty( $wp_styles->print_code ) ) {
2331
2564
                        echo "<style type='text/css'>\n";
2332
2565
                        echo $wp_styles->print_code;
2333
2566
                        echo "\n</style>\n";
2334
2567
                }
2335
2568
        }
2336
2569
 
2337
 
        if ( !empty($wp_styles->print_html) )
 
2570
        if ( ! empty( $wp_styles->print_html ) ) {
2338
2571
                echo $wp_styles->print_html;
 
2572
        }
2339
2573
}
2340
2574
 
2341
2575
/**
2350
2584
function script_concat_settings() {
2351
2585
        global $concatenate_scripts, $compress_scripts, $compress_css;
2352
2586
 
2353
 
        $compressed_output = ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') );
 
2587
        $compressed_output = ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' == ini_get( 'output_handler' ) );
2354
2588
 
2355
 
        if ( ! isset($concatenate_scripts) ) {
2356
 
                $concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;
2357
 
                if ( ( ! is_admin() && ! did_action( 'login_init' ) ) || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) )
 
2589
        if ( ! isset( $concatenate_scripts ) ) {
 
2590
                $concatenate_scripts = defined( 'CONCATENATE_SCRIPTS' ) ? CONCATENATE_SCRIPTS : true;
 
2591
                if ( ( ! is_admin() && ! did_action( 'login_init' ) ) || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) {
2358
2592
                        $concatenate_scripts = false;
 
2593
                }
2359
2594
        }
2360
2595
 
2361
 
        if ( ! isset($compress_scripts) ) {
2362
 
                $compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true;
2363
 
                if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
 
2596
        if ( ! isset( $compress_scripts ) ) {
 
2597
                $compress_scripts = defined( 'COMPRESS_SCRIPTS' ) ? COMPRESS_SCRIPTS : true;
 
2598
                if ( $compress_scripts && ( ! get_site_option( 'can_compress_scripts' ) || $compressed_output ) ) {
2364
2599
                        $compress_scripts = false;
 
2600
                }
2365
2601
        }
2366
2602
 
2367
 
        if ( ! isset($compress_css) ) {
2368
 
                $compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true;
2369
 
                if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )
 
2603
        if ( ! isset( $compress_css ) ) {
 
2604
                $compress_css = defined( 'COMPRESS_CSS' ) ? COMPRESS_CSS : true;
 
2605
                if ( $compress_css && ( ! get_site_option( 'can_compress_scripts' ) || $compressed_output ) ) {
2370
2606
                        $compress_css = false;
 
2607
                }
2371
2608
        }
2372
2609
}
2373
2610
 
2393
2630
        }
2394
2631
 
2395
2632
        /**
2396
 
         * Fires after enqueuing block assets for both editor and front-end.
2397
 
         *
2398
 
         * Call `add_action` on any hook before 'wp_enqueue_scripts'.
2399
 
         *
2400
 
         * In the function call you supply, simply use `wp_enqueue_script` and
2401
 
         * `wp_enqueue_style` to add your functionality to the Gutenberg editor.
2402
 
         *
2403
 
         * @since 5.0.0
2404
 
         */
 
2633
         * Fires after enqueuing block assets for both editor and front-end.
 
2634
         *
 
2635
         * Call `add_action` on any hook before 'wp_enqueue_scripts'.
 
2636
         *
 
2637
         * In the function call you supply, simply use `wp_enqueue_script` and
 
2638
         * `wp_enqueue_style` to add your functionality to the Gutenberg editor.
 
2639
         *
 
2640
         * @since 5.0.0
 
2641
         */
2405
2642
          do_action( 'enqueue_block_assets' );
2406
2643
}
2407
2644