Repository navigation
Commit 2419dda
committed
Administration: Wrap more one-liner inline scripts.
Continuing the migration begun in r63481, the raw one-liner `SCRIPT` tags in `wp-admin/admin-footer.php`, `wp-admin/install.php` and `wp-admin/async-upload.php` now print through `wp_print_inline_script_tag()`, so `wp_inline_script_attributes` can attach a per-request nonce to these as well.
The upload error handler is reworked in the process:
1. Its data now crosses into JavaScript as a single `wp_json_encode()` object rather than being interpolated into the script text, which also removes the raw interpolation of the dismiss button's generated `id`.
2. The jQuery object arrives as an argument instead of being read from the global scope four times.
3. `setTimeout()` replaces the lone `_.delay()` call, which was all the snippet wanted from Underscore.
The two blocks that take an argument carry a JSDoc block naming its type, following the convention already used for the jQuery wrapper in `wp-admin/js`. These particular blocks are not reached by `lint:jsdoc`, which reads JavaScript files rather than heredocs embedded in PHP, but IDEs do check them.
Developed in WordPress#13393.
Follow-up to r60263, r60520, r60681, r63481.
Props thanhtinpk, westonruter.
See #59446, #66033.
git-svn-id: https://develop.svn.wordpress.org/trunk@63545 602fd350-edb4-49c9-b593-d223f7449a821 parent 46ab13c commit 2419dda
3 files changed
Lines changed: 66 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
118 | 126 | | |
119 | 127 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
149 | 184 | | |
150 | 185 | | |
151 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
474 | | - | |
475 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
476 | 481 | | |
477 | 482 | | |
478 | 483 | | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
479 | 497 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | 498 | | |
486 | 499 | | |
0 commit comments