| @@ -33,9 +33,9 @@ | ||
| 33 | 33 | * '1.0.0', |
| 34 | 34 | * true |
| 35 | 35 | * ); |
| 36 | 36 | * wp_enqueue_script( 'my-plugin-titlebar' ); |
| 37 | - * } ); | |
| 37 | + * }, 5 ); // Before the shell harvests the payload at priority 10. | |
| 38 | 38 | * openstation_register_titlebar_button_script( 'my-plugin-titlebar' ); |
| 39 | 39 | * ``` |
| 40 | 40 | * |
| 41 | 41 | * For live unregistration on deactivation, the plugin's JS should |
| @@ -140,8 +140,11 @@ | ||
| 140 | 140 | 'scriptBefore' => $payload['before'], |
| 141 | 141 | 'scriptAfter' => $payload['after'], |
| 142 | 142 | 'scriptL10n' => $payload['l10n'], |
| 143 | 143 | 'scriptTranslations' => $payload['translations'], |
| 144 | + // The handle's dependency closure, replayed before the bundle | |
| 145 | + // on its lazy load — see `openstation_resolve_script_dependencies()`. | |
| 146 | + 'scriptDeps' => openstation_resolve_script_dependencies( $handle ), | |
| 144 | 147 | ); |
| 145 | 148 | $seen[ $handle ] = true; |
| 146 | 149 | } |
| 147 | 150 | return $out; |