Make WordPress Core


Ignore:
Timestamp:
11/08/2011 06:05:59 PM (15 years ago)
Author:
azaozz
Message:

Ressurect WP_Scripts::localize() and fix public function names, fixes #11520

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/script-loader.php

    r19215 r19217  
    6363
    6464        $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20111106a', 1 );
    65         $scripts->add_script_data( 'common', 'commonL10n', array(
     65        $scripts->localize( 'common', 'commonL10n', array(
    6666                'warnDelete' => __("You are about to permanently delete the selected items.\n  'Cancel' to stop, 'OK' to delete.")
    6767        ) );
     
    7070
    7171        $scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", false, '20111108', 1 );
    72         $scripts->add_script_data( 'quicktags', 'quicktagsL10n', array(
     72        $scripts->localize( 'quicktags', 'quicktagsL10n', array(
    7373                'wordLookup' => __('Enter a word to look up:'),
    7474                'dictionaryLookup' => esc_attr(__('Dictionary lookup')),
     
    9292
    9393        $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), '20091119', 1 );
    94         $scripts->add_script_data( 'wp-ajax-response', 'wpAjax', array(
     94        $scripts->localize( 'wp-ajax-response', 'wpAjax', array(
    9595                'noPerm' => __('You do not have permission to do that.'),
    9696                'broken' => __('An unidentified error has occurred.')
     
    9898
    9999        $scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), '20111017', 1 );
    100         $scripts->add_script_data( 'wp-pointer', 'wpPointerL10n', array(
     100        $scripts->localize( 'wp-pointer', 'wpPointerL10n', array(
    101101                'close' => __('Close'),
    102102        ) );
     
    167167
    168168        $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20110930', 1 );
    169         $scripts->add_script_data( 'thickbox', 'thickboxL10n', array(
     169        $scripts->localize( 'thickbox', 'thickboxL10n', array(
    170170                        'next' => __('Next >'),
    171171                        'prev' => __('< Prev'),
     
    222222
    223223        $scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-all', 'jquery'), '20111102');
    224         $scripts->add_script_data( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
     224        $scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
    225225
    226226        // keep 'swfupload' for back-compat.
     
    238238
    239239        $scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20110524');
    240         $scripts->add_script_data( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n );
     240        $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n );
    241241
    242242        $scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js", false, '20090102');
     
    247247
    248248        $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), '20101027', 1 );
    249         $scripts->add_script_data( 'password-strength-meter', 'pwsL10n', array(
     249        $scripts->localize( 'password-strength-meter', 'pwsL10n', array(
    250250                'empty' => __('Strength indicator'),
    251251                'short' => __('Very weak'),
     
    262262
    263263        $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wpdialogs' ), '20110929', 1 );
    264         $scripts->add_script_data( 'wplink', 'wpLinkL10n', array(
     264        $scripts->localize( 'wplink', 'wpLinkL10n', array(
    265265                'title' => __('Insert/edit link'),
    266266                'update' => __('Update'),
     
    281281                $scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ), '20090102' );
    282282                $scripts->add_data( 'ajaxcat', 'group', 1 );
    283                 $scripts->add_script_data( 'ajaxcat', 'catL10n', array(
     283                $scripts->localize( 'ajaxcat', 'catL10n', array(
    284284                        'add' => esc_attr(__('Add')),
    285285                        'how' => __('Separate multiple categories with commas.')
     
    289289
    290290                $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), '20110429', 1 );
    291                 $scripts->add_script_data( 'admin-tags', 'tagsl10n', array(
     291                $scripts->localize( 'admin-tags', 'tagsl10n', array(
    292292                        'noPerm' => __('You do not have permission to do that.'),
    293293                        'broken' => __('An unidentified error has occurred.')
     
    297297
    298298                $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'quicktags', 'jquery-query'), '20111026', 1 );
    299                 $scripts->add_script_data( 'admin-comments', 'adminCommentsL10n', array(
     299                $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
    300300                        'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
    301301                        'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']),
     
    309309
    310310                $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20110524', 1 );
    311                 $scripts->add_script_data( 'post', 'postL10n', array(
     311                $scripts->localize( 'post', 'postL10n', array(
    312312                        'ok' => __('OK'),
    313313                        'cancel' => __('Cancel'),
     
    334334                $scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array('jquery'), '20110429' );
    335335                $scripts->add_data( 'comment', 'group', 1 );
    336                 $scripts->add_script_data( 'comment', 'commentL10n', array(
     336                $scripts->localize( 'comment', 'commentL10n', array(
    337337                        'submittedOn' => __('Submitted on:')
    338338                ) );
     
    347347
    348348                $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), '20111107', 1 );
    349                 $scripts->add_script_data( 'inline-edit-post', 'inlineEditL10n', array(
     349                $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
    350350                        'error' => __('Error while saving the changes.'),
    351351                        'ntdeltitle' => __('Remove From Bulk Edit'),
     
    354354
    355355                $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), '20110609', 1 );
    356                 $scripts->add_script_data( 'inline-edit-tax', 'inlineEditL10n', array(
     356                $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
    357357                        'error' => __('Error while saving the changes.')
    358358                ) );
    359359
    360360                $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), '20110113', 1 );
    361                 $scripts->add_script_data( 'plugin-install', 'plugininstallL10n', array(
     361                $scripts->localize( 'plugin-install', 'plugininstallL10n', array(
    362362                        'plugin_information' => __('Plugin Information:'),
    363363                        'ays' => __('Are you sure you want to install this plugin?')
     
    375375
    376376                $scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), '20110927', 1 );
    377                 $scripts->add_script_data( 'image-edit', 'imageEditL10n', array(
     377                $scripts->localize( 'image-edit', 'imageEditL10n', array(
    378378                        'error' => __( 'Could not load the preview image. Please reload the page and try again.' )
    379379                ));
    380380
    381381                $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20100518', 1 );
    382                 $scripts->add_script_data( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
     382                $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
    383383                        'setThumbnail' => __( 'Use as featured image' ),
    384384                        'saving' => __( 'Saving...' ),
     
    389389                // Navigation Menus
    390390                $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array('jquery-ui-sortable'), '20110524' );
    391                 $scripts->add_script_data( 'nav-menu', 'navMenuL10n', array(
     391                $scripts->localize( 'nav-menu', 'navMenuL10n', array(
    392392                        'noResultsFound' => _x('No results found.', 'search results'),
    393393                        'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
Note: See TracChangeset for help on using the changeset viewer.