← All changes
|
modules/subscriptions/email-design-editor/class-jetpack-email-design-editor.php
+11
-1
16.3-a.1
→
16.3-beta
View file →
| @@ -342,10 +342,20 @@ | ||
| 342 | 342 | * @param string[] $allowed Handles to keep. |
| 343 | 343 | * @return array The `_wp_get_iframed_editor_assets()` shape, with `styles` filtered. |
| 344 | 344 | */ |
| 345 | 345 | private static function get_resolved_assets( array $allowed ) { |
| 346 | + // Core collects the canvas's assets by buffering `wp_print_footer_scripts()`, one of the two | |
| 347 | + // actions `wp_auth_check_load()` puts its "Session expired" dialog on. Core's own editor is | |
| 348 | + // built before `admin_enqueue_scripts` registers that; this screen is not. NL-957. | |
| 349 | + $had_auth_check = remove_action( 'wp_print_footer_scripts', 'wp_auth_check_html', 5 ); | |
| 350 | + | |
| 346 | 351 | $assets = _wp_get_iframed_editor_assets(); |
| 347 | - $kept = array(); | |
| 352 | + | |
| 353 | + if ( $had_auth_check ) { | |
| 354 | + add_action( 'wp_print_footer_scripts', 'wp_auth_check_html', 5 ); | |
| 355 | + } | |
| 356 | + | |
| 357 | + $kept = array(); | |
| 348 | 358 | |
| 349 | 359 | foreach ( explode( "\n", (string) $assets['styles'] ) as $asset ) { |
| 350 | 360 | foreach ( $allowed as $handle ) { |
| 351 | 361 | if ( str_contains( $asset, $handle ) ) { |