WordPress.org

Make WordPress Core

Ticket #51123: 51123.2.diff

File 51123.2.diff, 20.7 KB (added by peterwilsoncc, 11 months ago)
  • src/js/_enqueues/admin/common.js

    diff --git a/src/js/_enqueues/admin/common.js b/src/js/_enqueues/admin/common.js
    index 58f68d110f..b60191f527 100644
    a b  
    1616        var $document = $( document ),
    1717                $window = $( window ),
    1818                $body = $( document.body ),
    19                 __ = wp.i18n.__;
     19                __ = wp.i18n.__,
     20                _x = wp.i18n._x,
     21                sprintf = wp.i18n.sprintf;
     22
     23/**
     24 * Throws a warning for a deprecated property.
     25 *
     26 * @since 5.5.1
     27 *
     28 * @param {string} propName    The property that was used.
     29 * @param {string} version     The version of WordPress that deprecated the property.
     30 * @param {string} replacement The property that should have been used.
     31 */
     32function deprecatedProperty( propName, version, replacement ) {
     33        var message;
     34
     35        if ( 'undefined' !== typeof replacement ) {
     36                message = sprintf(
     37                        /* translators: 1: Deprecated property name, 2: Version number, 3: Alternative property name. */
     38                        __( '%1$s is deprecated since version %2$s! Use %3$s instead.' ),
     39                        propName,
     40                        version,
     41                        replacement
     42                );
     43        } else {
     44                message = sprintf(
     45                        /* translators: 1: Deprecated property name, 2: Version number. */
     46                        __( '%1$s is deprecated since version %2$s with no alternative available.' ),
     47                        propName,
     48                        version
     49                );
     50        }
     51
     52        window.console.warn( message );
     53}
     54
     55/**
     56 * Deprecate all properties on an object.
     57 *
     58 * @since 5.5.1
     59 *
     60 * @param {string} name       The name of the object, i.e. commonL10n.
     61 * @param {object} l10nObject The object to deprecate the properties on.
     62 *
     63 * @return {object} The object with all its properties deprecated.
     64 */
     65function deprecateL10nObject( name, l10nObject ) {
     66        var deprecatedObject = {};
     67
     68        Object.keys( l10nObject ).forEach( function( key ) {
     69                var prop = l10nObject[ key ];
     70                var propName = name + '.' + key;
     71
     72                if ( 'object' === typeof prop ) {
     73                        Object.defineProperty( deprecatedObject, key, { get: function() {
     74                                deprecatedProperty( propName, '5.5.0', prop.alternative );
     75                                return prop.func();
     76                        } } );
     77                } else {
     78                        Object.defineProperty( deprecatedObject, key, { get: function() {
     79                                deprecatedProperty( propName, '5.5.0', 'wp.i18n' );
     80                                return prop;
     81                        } } );
     82                }
     83        } );
     84
     85        return deprecatedObject;
     86}
     87
     88window.wp.deprecateL10nObject = deprecateL10nObject;
     89
     90/**
     91 * Removed in 5.5.0, needed for back-compatibility.
     92 *
     93 * @since 2.6.0
     94 * @deprecated 5.5.0
     95 */
     96window.commonL10n = window.commonL10n || {
     97        warnDelete: __( 'You are about to permanently delete these items from your site.\nThis action cannot be undone.\n\'Cancel\' to stop, \'OK\' to delete.' ),
     98        dismiss: __( 'Dismiss this notice.' ),
     99        collapseMenu: __( 'Collapse Main menu' ),
     100        expandMenu: __( 'Expand Main menu' )
     101};
     102
     103window.commonL10n = deprecateL10nObject( 'commonL10n', window.commonL10n );
     104
     105/**
     106 * Removed in 5.5.0, needed for back-compatibility.
     107 *
     108 * @since 3.3.0
     109 * @deprecated 5.5.0
     110 */
     111window.wpPointerL10n = window.wpPointerL10n || {
     112        dismiss: __( 'Dismiss' )
     113};
     114
     115window.wpPointerL10n = deprecateL10nObject( 'wpPointerL10n', window.wpPointerL10n );
     116
     117/**
     118 * Removed in 5.5.0, needed for back-compatibility.
     119 *
     120 * @deprecated 5.5.0
     121 */
     122window.userProfileL10n = window.userProfileL10n || {
     123        warn: __( 'Your new password has not been saved.' ),
     124        warnWeak: __( 'Confirm use of weak password' ),
     125        show: __( 'Show' ),
     126        hide: __( 'Hide' ),
     127        cancel: __( 'Cancel' ),
     128        ariaShow: __( 'Show password' ),
     129        ariaHide: __( 'Hide password' )
     130};
     131
     132window.userProfileL10n = deprecateL10nObject( 'userProfileL10n', window.userProfileL10n );
     133
     134/**
     135 * Removed in 5.5.0, needed for back-compatibility.
     136 *
     137 * @since 4.9.6
     138 * @deprecated 5.5.0
     139 */
     140window.privacyToolsL10n = window.privacyToolsL10n || {
     141        noDataFound: __( 'No personal data was found for this user.' ),
     142        foundAndRemoved: __( 'All of the personal data found for this user was erased.' ),
     143        noneRemoved: __( 'Personal data was found for this user but was not erased.' ),
     144        someNotRemoved: __( 'Personal data was found for this user but some of the personal data found was not erased.' ),
     145        removalError: __( 'An error occurred while attempting to find and erase personal data.' ),
     146        emailSent: __( 'The personal data export link for this user was sent.' ),
     147        noExportFile: __( 'No personal data export file was generated.' ),
     148        exportError: __( 'An error occurred while attempting to export personal data.' )
     149};
     150
     151window.privacyToolsL10n = deprecateL10nObject( 'privacyToolsL10n', window.privacyToolsL10n );
     152
     153/**
     154 * Removed in 5.5.0, needed for back-compatibility.
     155 *
     156 * @since 3.6.0
     157 * @deprecated 5.5.0
     158 */
     159window.authcheckL10n = {
     160        beforeunload: __( 'Your session has expired. You can log in again from this page or go to the login page.' )
     161};
     162
     163window.authcheckL10n = window.authcheckL10n || deprecateL10nObject( 'authcheckL10n', window.authcheckL10n );
     164
     165/**
     166 * Removed in 5.5.0, needed for back-compatibility.
     167 *
     168 * @since 2.8.0
     169 * @deprecated 5.5.0
     170 */
     171window.tagsl10n = {
     172        noPerm: __( 'Sorry, you are not allowed to do that.' ),
     173        broken: __( 'Something went wrong.' )
     174};
     175
     176window.tagsl10n = window.tagsl10n || deprecateL10nObject( 'tagsl10n', window.tagsl10n );
     177
     178/**
     179 * Removed in 5.5.0, needed for back-compatibility.
     180 *
     181 * @since 2.5.0
     182 * @deprecated 5.5.0
     183 */
     184window.adminCommentsL10n = window.adminCommentsL10n || {
     185        hotkeys_highlight_first: {
     186                alternative: 'window.adminCommentsSettings.hotkeys_highlight_first',
     187                func: function() { return window.adminCommentsSettings.hotkeys_highlight_first; }
     188        },
     189        hotkeys_highlight_last: {
     190                alternative: 'window.adminCommentsSettings.hotkeys_highlight_last',
     191                func: function() { return window.adminCommentsSettings.hotkeys_highlight_last; }
     192        },
     193        replyApprove: __( 'Approve and Reply' ),
     194        reply: __( 'Reply' ),
     195        warnQuickEdit: __( 'Are you sure you want to edit this comment?\nThe changes you made will be lost.' ),
     196        warnCommentChanges: __( 'Are you sure you want to do this?\nThe comment changes you made will be lost.' ),
     197        docTitleComments: __( 'Comments' ),
     198        /* translators: %s: Comments count. */
     199        docTitleCommentsCount: __( 'Comments (%s)' )
     200};
     201
     202window.adminCommentsL10n = deprecateL10nObject( 'adminCommentsL10n', window.adminCommentsL10n );
     203
     204/**
     205 * Removed in 5.5.0, needed for back-compatibility.
     206 *
     207 * @since 2.5.0
     208 * @deprecated 5.5.0
     209 */
     210window.tagsl10n = window.tagsl10n || {
     211        tagDelimiter: _x( ',', 'tag delimiter' ),
     212        removeTerm: __( 'Remove term:' ),
     213        termSelected: __( 'Term selected.' ),
     214        termAdded: __( 'Term added.' ),
     215        termRemoved: __( 'Term removed.' )
     216};
     217
     218window.tagsL10n = deprecateL10nObject( 'tagsl10n', window.tagsl10n );
     219
     220/**
     221 * Removed in 5.5.0, needed for back-compatibility.
     222 *
     223 * @since 3.5.0
     224 * @deprecated 5.5.0
     225 */
     226window.wpColorPickerL10n = window.wpColorPickerL10n || {
     227        clear: __( 'Clear' ),
     228        clearAriaLabel: __( 'Clear color' ),
     229        defaultString: __( 'Default' ),
     230        defaultAriaLabel: __( 'Select default color' ),
     231        pick: __( 'Select Color' ),
     232        defaultLabel: __( 'Color value' )
     233};
     234
     235window.wpColorPickerL10n = deprecateL10nObject( 'wpColorPickerL10n', window.wpColorPickerL10n );
     236
     237/**
     238 * Removed in 5.5.0, needed for back-compatibility.
     239 *
     240 * @since 2.7.0
     241 * @deprecated 5.5.0
     242 */
     243window.attachMediaBoxL10n = window.attachMediaBoxL10n || {
     244        error: __( 'An error has occurred. Please reload the page and try again.' )
     245};
     246
     247window.attachMediaBoxL10n = deprecateL10nObject( 'attachMediaBoxL10n', window.attachMediaBoxL10n );
     248
     249/**
     250 * Removed in 5.5.0, needed for back-compatibility.
     251 *
     252 * @deprecated 5.5.0
     253 */
     254window.postL10n = window.postL10n || {
     255        ok: __( 'OK' ),
     256        cancel: __( 'Cancel' ),
     257        publishOn: __( 'Publish on:' ),
     258        publishOnFuture: __( 'Schedule for:' ),
     259        publishOnPast: __( 'Published on:' ),
     260        /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
     261        dateFormat: __( '%1$s %2$s, %3$s at %4$s:%5$s' ),
     262        showcomm: __( 'Show more comments' ),
     263        endcomm: __( 'No more comments found.' ),
     264        publish: __( 'Publish' ),
     265        schedule: _x( 'Schedule', 'post action/button label' ),
     266        update: __( 'Update' ),
     267        savePending: __( 'Save as Pending' ),
     268        saveDraft: __( 'Save Draft' ),
     269        'private': __( 'Private' ),
     270        'public': __( 'Public' ),
     271        publicSticky: __( 'Public, Sticky' ),
     272        password: __( 'Password Protected' ),
     273        privatelyPublished: __( 'Privately Published' ),
     274        published: __( 'Published' ),
     275        saveAlert: __( 'The changes you made will be lost if you navigate away from this page.' ),
     276        savingText: __( 'Saving Draft…' ),
     277        permalinkSaved: __( 'Permalink saved' )
     278};
     279
     280window.postL10n = deprecateL10nObject( 'postL10n', window.postL10n );
     281
     282/**
     283 * Removed in 5.5.0, needed for back-compatibility.
     284 *
     285 * @since 2.7.0
     286 * @deprecated 5.5.0
     287 */
     288window.inlineEditL10n = window.inlineEditL10n || {
     289        error: __( 'Error while saving the changes.' ),
     290        ntdeltitle: __( 'Remove From Bulk Edit' ),
     291        notitle: __( '(no title)' ),
     292        comma: _x( ',', 'tag delimiter' ).trim(),
     293        saved: __( 'Changes saved.' )
     294};
     295
     296window.inlineEditL10n = deprecateL10nObject( 'inlineEditL10n', window.inlineEditL10n );
     297
     298/**
     299 * Removed in 5.5.0, needed for back-compatibility.
     300 *
     301 * @deprecated 5.5.0
     302 */
     303window.plugininstallL10n = window.plugininstallL10n || {
     304        plugin_information: __( 'Plugin:' ),
     305        plugin_modal_label: __( 'Plugin details' ),
     306        ays: __( 'Are you sure you want to install this plugin?' )
     307};
     308
     309window.plugininstallL10n = deprecateL10nObject( 'plugininstallL10n', window.plugininstallL10n );
     310
     311/**
     312 * Removed in 5.5.0, needed for back-compatibility.
     313 *
     314 * @deprecated 5.5.0
     315 */
     316window.navMenuL10n = window.navMenuL10n || {
     317        noResultsFound: __( 'No results found.' ),
     318        warnDeleteMenu: __( 'You are about to permanently delete this menu.\n\'Cancel\' to stop, \'OK\' to delete.' ),
     319        saveAlert: __( 'The changes you made will be lost if you navigate away from this page.' ),
     320        untitled: _x( '(no label)', 'missing menu item navigation label' )
     321};
     322
     323window.navMenuL10n = deprecateL10nObject( 'navMenuL10n', window.navMenuL10n );
     324
     325/**
     326 * Removed in 5.5.0, needed for back-compatibility.
     327 *
     328 * @since 2.5.0
     329 * @deprecated 5.5.0
     330 */
     331window.commentL10n = window.commentL10n || {
     332        submittedOn: __( 'Submitted on:' ),
     333        /* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
     334        dateFormat: __( '%1$s %2$s, %3$s at %4$s:%5$s' )
     335};
     336
     337window.commentL10n = deprecateL10nObject( 'commentL10n', window.commentL10n );
     338
     339/**
     340 * Removed in 5.5.0, needed for back-compatibility.
     341 *
     342 * @deprecated 5.5.0
     343 */
     344window.setPostThumbnailL10n = window.setPostThumbnailL10n || {
     345        setThumbnail: __( 'Use as featured image' ),
     346        saving: __( 'Saving…' ),
     347        error: __( 'Could not set that as the thumbnail image. Try a different attachment.' ),
     348        done: __( 'Done' )
     349};
     350
     351window.setPostThumbnailL10n = deprecateL10nObject( 'setPostThumbnailL10n', window.setPostThumbnailL10n );
     352
    20353
    21354/**
    22355 * Removed in 3.3.0, needed for back-compatibility.
  • src/js/_enqueues/admin/widgets.js

    diff --git a/src/js/_enqueues/admin/widgets.js b/src/js/_enqueues/admin/widgets.js
    index e0dac1f4db..2f71d8766c 100644
    a b window.wpWidgets = { 
    744744$document.ready( function(){ wpWidgets.init(); } );
    745745
    746746})(jQuery);
     747
     748wpWidgets.l10n = wpWidgets.l10n || {
     749        save: wp.i18n.__( 'Save' ),
     750        saved: wp.i18n.__( 'Saved' ),
     751        saveAlert: wp.i18n.__( 'The changes you made will be lost if you navigate away from this page.' ),
     752        widgetAdded: wp.i18n.__( 'Widget has been added to the selected sidebar' )
     753};
     754
     755wpWidgets.l10n = window.wp.deprecateL10nObject( 'wpWidgets.l10n', wpWidgets.l10n );
  • src/js/_enqueues/wp/theme-plugin-editor.js

    diff --git a/src/js/_enqueues/wp/theme-plugin-editor.js b/src/js/_enqueues/wp/theme-plugin-editor.js
    index 9516b0f003..8aec2e2400 100644
    a b wp.themePluginEditor = (function( $ ) { 
    10001000
    10011001        return component;
    10021002})( jQuery );
     1003
     1004wp.themePluginEditor.l10n = wp.themePluginEditor.l10n || {
     1005        saveAlert: wp.i18n.__( 'The changes you made will be lost if you navigate away from this page.' ),
     1006        saveError: wp.i18n.__( '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.' ),
     1007        lintError: {
     1008                alternative: 'wp.i18n',
     1009                func: function() {
     1010                        return {
     1011                                /* translators: %d: Error count. */
     1012                                singular: wp.i18n._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 ),
     1013                                /* translators: %d: Error count. */
     1014                                plural: wp.i18n._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 )
     1015                        };
     1016                }
     1017        }
     1018};
     1019
     1020wp.themePluginEditor.l10n = window.wp.deprecateL10nObject( 'wp.themePluginEditor.l10n', wp.themePluginEditor.l10n );
  • src/js/_enqueues/wp/updates.js

    diff --git a/src/js/_enqueues/wp/updates.js b/src/js/_enqueues/wp/updates.js
    index 48a256bd5e..fc146c6a13 100644
    a b  
    4242         */
    4343        wp.updates = {};
    4444
     45        /**
     46         * Removed in 5.5.0, needed for back-compatibility.
     47         *
     48         * @since 4.2.0
     49         * @deprecated 5.5.0
     50         *
     51         * @type {object}
     52         */
     53        wp.updates.l10n = {
     54                /* translators: %s: Search query. */
     55                'searchResults': __( 'Search results for “%s”' ),
     56                'searchResultsLabel': __( 'Search Results' ),
     57                'noPlugins': __( 'You do not appear to have any plugins available at this time.' ),
     58                'noItemsSelected': __( 'Please select at least one item to perform this action on.' ),
     59                'updating': __( 'Updating...' ), // No ellipsis.
     60                'pluginUpdated': _x( 'Updated!', 'plugin' ),
     61                'themeUpdated': _x( 'Updated!', 'theme' ),
     62                'update': __( 'Update' ),
     63                'updateNow': __( 'Update Now' ),
     64                /* translators: %s: Plugin name and version. */
     65                'pluginUpdateNowLabel': _x( 'Update %s now', 'plugin' ),
     66                'updateFailedShort': __( 'Update Failed!' ),
     67                /* translators: %s: Error string for a failed update. */
     68                'updateFailed': __( 'Update Failed: %s' ),
     69                /* translators: %s: Plugin name and version. */
     70                'pluginUpdatingLabel': _x( 'Updating %s...', 'plugin' ), // No ellipsis.
     71                /* translators: %s: Plugin name and version. */
     72                'pluginUpdatedLabel': _x( '%s updated!', 'plugin' ),
     73                /* translators: %s: Plugin name and version. */
     74                'pluginUpdateFailedLabel': _x( '%s update failed', 'plugin' ),
     75                /* translators: Accessibility text. */
     76                'updatingMsg': __( 'Updating... please wait.' ), // No ellipsis.
     77                /* translators: Accessibility text. */
     78                'updatedMsg': __( 'Update completed successfully.' ),
     79                /* translators: Accessibility text. */
     80                'updateCancel': __( 'Update canceled.' ),
     81                'beforeunload': __( 'Updates may not complete if you navigate away from this page.' ),
     82                'installNow': __( 'Install Now' ),
     83                /* translators: %s: Plugin name. */
     84                'pluginInstallNowLabel': _x( 'Install %s now', 'plugin' ),
     85                'installing': __( 'Installing...' ),
     86                'pluginInstalled': _x( 'Installed!', 'plugin' ),
     87                'themeInstalled': _x( 'Installed!', 'theme' ),
     88                'installFailedShort': __( 'Installation Failed!' ),
     89                /* translators: %s: Error string for a failed installation. */
     90                'installFailed': __( 'Installation failed: %s' ),
     91                /* translators: %s: Plugin name and version. */
     92                'pluginInstallingLabel': _x( 'Installing %s...', 'plugin' ), // No ellipsis.
     93                /* translators: %s: Theme name and version. */
     94                'themeInstallingLabel': _x( 'Installing %s...', 'theme' ), // No ellipsis.
     95                /* translators: %s: Plugin name and version. */
     96                'pluginInstalledLabel': _x( '%s installed!', 'plugin' ),
     97                /* translators: %s: Theme name and version. */
     98                'themeInstalledLabel': _x( '%s installed!', 'theme' ),
     99                /* translators: %s: Plugin name and version. */
     100                'pluginInstallFailedLabel': _x( '%s installation failed', 'plugin' ),
     101                /* translators: %s: Theme name and version. */
     102                'themeInstallFailedLabel': _x( '%s installation failed', 'theme' ),
     103                'installingMsg': __( 'Installing... please wait.' ),
     104                'installedMsg': __( 'Installation completed successfully.' ),
     105                /* translators: %s: Activation URL. */
     106                'importerInstalledMsg': __( 'Importer installed successfully. <a href="%s">Run importer</a>' ),
     107                /* translators: %s: Theme name. */
     108                'aysDelete': __( 'Are you sure you want to delete %s?' ),
     109                /* translators: %s: Plugin name. */
     110                'aysDeleteUninstall': __( 'Are you sure you want to delete %s and its data?' ),
     111                'aysBulkDelete': __( 'Are you sure you want to delete the selected plugins and their data?' ),
     112                'aysBulkDeleteThemes': __( 'Caution: These themes may be active on other sites in the network. Are you sure you want to proceed?' ),
     113                'deleting': __( 'Deleting...' ),
     114                /* translators: %s: Error string for a failed deletion. */
     115                'deleteFailed': __( 'Deletion failed: %s' ),
     116                'pluginDeleted': _x( 'Deleted!', 'plugin' ),
     117                'themeDeleted': _x( 'Deleted!', 'theme' ),
     118                'livePreview': __( 'Live Preview' ),
     119                'activatePlugin': 'plugins-network' === pagenow ? __( 'Network Activate' ) : __( 'Activate' ),
     120                'activateTheme': 'plugins-network' === pagenow ? __( 'Network Enable' ) : __( 'Activate' ),
     121                /* translators: %s: Plugin name. */
     122                'activatePluginLabel': 'plugins-network' === pagenow ? _x( 'Network Activate %s', 'plugin' ) : _x( 'Activate %s', 'plugin' ),
     123                /* translators: %s: Theme name. */
     124                'activateThemeLabel': 'plugins-network' === pagenow ? _x( 'Network Activate %s', 'theme' ) : _x( 'Activate %s', 'theme' ),
     125                'activateImporter': __( 'Run Importer' ),
     126                /* translators: %s: Importer name. */
     127                'activateImporterLabel': __( 'Run %s' ),
     128                'unknownError': __( 'Something went wrong.' ),
     129                'connectionError': __( 'Connection lost or the server is busy. Please try again later.' ),
     130                'nonceError': __( 'An error has occurred. Please reload the page and try again.' ),
     131                /* translators: %s: Number of plugins. */
     132                'pluginsFound': __( 'Number of plugins found: %d' ),
     133                'noPluginsFound': __( 'No plugins found. Try a different search.' ),
     134                'autoUpdatesEnable': __( 'Enable auto-updates' ),
     135                'autoUpdatesEnabling': __( 'Enabling...' ),
     136                'autoUpdatesEnabled': __( 'Auto-updates enabled' ),
     137                'autoUpdatesDisable': __( 'Disable auto-updates' ),
     138                'autoUpdatesDisabling': __( 'Disabling...' ),
     139                'autoUpdatesDisabled': __( 'Auto-updates disabled' ),
     140                'autoUpdatesError': __( 'The request could not be completed.' )
     141        };
     142
     143        wp.updates.l10n = window.wp.deprecateL10nObject( 'wp.updates.l10n', wp.updates.l10n );
     144
    45145        /**
    46146         * User nonce for ajax calls.
    47147         *
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index 6f59ec8e06..31c524834a 100644
    a b function wp_default_scripts( $scripts ) { 
    10131013        $scripts->add( 'htmlhint', '/wp-includes/js/codemirror/htmlhint.js', array(), '0.9.14-xwp' );
    10141014        $scripts->add( 'htmlhint-kses', '/wp-includes/js/codemirror/htmlhint-kses.js', array( 'htmlhint' ) );
    10151015        $scripts->add( 'code-editor', "/wp-admin/js/code-editor$suffix.js", array( 'jquery', 'wp-codemirror', 'underscore' ) );
    1016         $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' ) );
     1016        $scripts->add( 'wp-theme-plugin-editor', "/wp-admin/js/theme-plugin-editor$suffix.js", array( 'common', 'wp-util', 'wp-sanitize', 'jquery', 'jquery-ui-core', 'wp-a11y', 'underscore' ) );
    10171017        $scripts->set_translations( 'wp-theme-plugin-editor' );
    10181018
    10191019        $scripts->add( 'wp-playlist', "/wp-includes/js/mediaelement/wp-playlist$suffix.js", array( 'wp-util', 'backbone', 'mediaelement' ), false, 1 );
    function wp_default_scripts( $scripts ) { 
    12311231
    12321232                $scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ) );
    12331233
    1234                 $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-a11y' ), false, 1 );
     1234                $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'common', 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-a11y' ), false, 1 );
    12351235                $scripts->set_translations( 'admin-widgets' );
    12361236
    12371237                $scripts->add( 'media-widgets', "/wp-admin/js/widgets/media-widgets$suffix.js", array( 'jquery', 'media-models', 'media-views', 'wp-api-request' ) );
    function wp_default_scripts( $scripts ) { 
    12611261                $scripts->add( 'privacy-tools', "/wp-admin/js/privacy-tools$suffix.js", array( 'jquery', 'wp-a11y' ), false, 1 );
    12621262                $scripts->set_translations( 'privacy-tools' );
    12631263
    1264                 $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y', 'wp-sanitize' ), false, 1 );
     1264                $scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'common', 'jquery', 'wp-util', 'wp-a11y', 'wp-sanitize' ), false, 1 );
    12651265                $scripts->set_translations( 'updates' );
    12661266                did_action( 'init' ) && $scripts->localize(
    12671267                        'updates',