Repository navigation
Commit 2004e9f
committed
Administration: Use script helper for list table JS vars.
Print the inline scripts in `WP_List_Table::_js_vars()` and `WP_Themes_List_Table::_js_vars()` via `wp_print_inline_script_tag()` instead of manually constructing `SCRIPT` tags with `printf()`. This allows attributes to be added via the `wp_inline_script_attributes` filter, such as a nonce needed to opt in to a Strict Content Security Policy. This affects the Comments screen, the Activity dashboard widget, and the Comments meta box on the post edit screen. The `list_args` global is now also declared with `var` so that the assignment remains valid in strict mode.
Developed in #13646.
Follow-up to r56687, r63481, r63545.
Props sjackson0109, westonruter.
See #59446.
git-svn-id: https://develop.svn.wordpress.org/trunk@63878 602fd350-edb4-49c9-b593-d223f7449a821 parent 1be36a0 commit 2004e9f
3 files changed
Lines changed: 65 additions & 2 deletions
File tree
- src/wp-admin/includes
- tests/phpunit/tests/admin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1922 | 1922 | | |
1923 | 1923 | | |
1924 | 1924 | | |
| 1925 | + | |
| 1926 | + | |
1925 | 1927 | | |
1926 | 1928 | | |
1927 | 1929 | | |
| |||
1932 | 1934 | | |
1933 | 1935 | | |
1934 | 1936 | | |
1935 | | - | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
1936 | 1940 | | |
1937 | 1941 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
| 344 | + | |
343 | 345 | | |
344 | 346 | | |
345 | 347 | | |
| |||
357 | 359 | | |
358 | 360 | | |
359 | 361 | | |
360 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
361 | 365 | | |
362 | 366 | | |
363 | 367 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
604 | 659 | | |
0 commit comments