Pascal Birchler
5d6024cefb
Script Loader: Ensure wp_localize_script()
works when called early.
...
Before, `wp_localize_script()` did not work when the `$wp_scripts` global was not already set (for example because of a script registration happening elsewhere) and even emitted a warning in that case. Due to side effects such as block registration early in the load process, this usually never happened. However, the absence of these side effects in 6.5 caused the `wp_localize_script()` to no longer work in places such as the `login_enqueue_scripts`.
By calling `wp_scripts()` in `wp_localize_script()`, the `$wp_scripts` global is automatically set if needed, restoring previous behavior. Adds both a PHP unit test and an e2e test to verify this use case. Hat tip: jorbin.
Happy birthday, Aaron!
Props salcode, aslamdoctor, jorbin, swissspidy.
Fixes #60862 .
Built from https://develop.svn.wordpress.org/trunk@58068
git-svn-id: http://core.svn.wordpress.org/trunk@57533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-01 15:42:11 +00:00
..
2024-04-09 10:57:27 +00:00
2024-03-04 14:08:24 +00:00
2024-02-20 11:22:09 +00:00
2024-04-09 10:57:27 +00:00
2024-04-30 08:44:05 +00:00
2024-03-05 00:12:11 +00:00
2024-03-22 14:17:09 +00:00
2024-04-24 07:45:14 +00:00
2024-02-15 23:49:10 +00:00
2024-03-15 12:12:09 +00:00
2024-04-12 17:47:13 +00:00
2024-04-15 20:03:09 +00:00
2023-11-26 19:27:25 +00:00
2024-03-27 12:30:12 +00:00
2024-03-25 12:23:08 +00:00
2024-04-30 09:33:05 +00:00
2024-01-31 02:54:17 +00:00
2024-01-18 22:13:16 +00:00
2023-11-26 16:43:30 +00:00
2024-04-22 21:06:08 +00:00
2024-02-16 12:55:11 +00:00
2024-02-27 21:05:11 +00:00
2024-04-24 12:11:15 +00:00
2024-03-06 05:05:12 +00:00
2024-02-21 11:20:10 +00:00
2024-03-20 12:49:10 +00:00
2024-03-23 14:20:11 +00:00
2024-02-16 23:34:11 +00:00
2024-04-26 15:02:14 +00:00
2024-02-17 13:25:10 +00:00
2024-03-18 15:46:13 +00:00
2024-03-04 21:50:11 +00:00
2024-04-21 03:52:11 +00:00
2024-02-16 12:55:11 +00:00
2024-02-27 21:05:11 +00:00
2024-04-19 03:42:18 +00:00
2024-02-23 09:20:12 +00:00
2024-03-02 13:38:07 +00:00
2024-01-28 07:50:18 +00:00
2024-03-11 14:08:10 +00:00
2024-02-16 21:47:12 +00:00
2024-01-18 22:13:16 +00:00
2024-02-16 21:47:12 +00:00
2024-02-18 14:59:07 +00:00
2023-12-16 09:31:29 +00:00
2023-12-16 09:38:25 +00:00
2024-04-07 11:18:17 +00:00
2024-04-03 10:33:24 +00:00
2024-04-06 13:37:18 +00:00
2024-02-02 17:48:15 +00:00
2024-02-27 22:38:15 +00:00
2024-01-25 07:53:17 +00:00
2024-02-06 01:25:14 +00:00
2024-04-22 20:25:08 +00:00
2024-03-02 13:38:07 +00:00
2024-03-06 05:05:12 +00:00
2024-03-11 14:08:10 +00:00
2024-02-16 21:47:12 +00:00
2024-03-08 14:34:11 +00:00
2024-02-13 15:13:17 +00:00
2024-03-04 14:48:13 +00:00
2023-12-24 13:05:21 +00:00
2024-03-15 11:29:07 +00:00
2024-02-05 09:43:12 +00:00
2024-03-02 13:38:07 +00:00
2024-02-16 21:47:12 +00:00
2024-03-02 13:38:07 +00:00
2024-02-14 19:27:09 +00:00
2024-03-14 09:05:11 +00:00
2024-03-27 16:00:12 +00:00
2024-04-22 07:20:09 +00:00
2024-04-19 17:59:16 +00:00
2024-04-25 10:49:16 +00:00
2024-02-16 21:47:12 +00:00
2024-03-17 09:56:16 +00:00
2024-02-11 19:14:19 +00:00
2024-04-04 15:13:14 +00:00
2024-02-21 19:26:08 +00:00
2024-02-17 15:24:08 +00:00
2024-04-11 21:11:16 +00:00
2024-01-03 21:59:19 +00:00
2024-04-17 09:46:19 +00:00
2024-04-03 21:31:15 +00:00
2024-04-01 20:45:13 +00:00
2024-04-12 17:47:13 +00:00
2024-03-04 12:41:10 +00:00
2024-03-04 12:41:10 +00:00
2024-04-01 02:53:12 +00:00
2024-04-01 20:55:12 +00:00
2024-04-12 17:47:13 +00:00
2024-05-01 15:42:11 +00:00
2024-03-07 07:08:09 +00:00
2024-04-20 04:01:18 +00:00
2023-12-26 14:24:21 +00:00
2024-04-30 08:39:07 +00:00
2024-03-22 22:07:11 +00:00
2024-03-14 09:05:11 +00:00
2024-04-23 12:38:14 +00:00
2024-03-29 11:42:13 +00:00
2024-04-12 17:47:13 +00:00
2024-03-25 17:19:17 +00:00
2024-04-12 17:47:13 +00:00
2024-04-03 21:31:15 +00:00
2024-04-13 16:33:13 +00:00
2024-04-29 22:32:08 +00:00
2024-02-22 09:54:08 +00:00
2024-01-28 08:19:17 +00:00
2024-04-10 14:42:17 +00:00
2024-04-23 12:38:14 +00:00
2024-02-22 15:53:13 +00:00
2024-02-16 21:47:12 +00:00
2024-02-21 19:26:08 +00:00
2023-12-08 06:32:24 +00:00
2024-03-27 16:00:12 +00:00
2024-04-12 17:47:13 +00:00
2024-02-26 10:43:06 +00:00
2024-04-04 13:40:06 +00:00
2024-05-01 15:42:11 +00:00
2024-01-28 08:19:17 +00:00