File tree Expand file tree Collapse file tree 1 file changed +0
-29
lines changed
Expand file tree Collapse file tree 1 file changed +0
-29
lines changed Original file line number Diff line number Diff line change 4646 ])->toHtml ();
4747});
4848
49- /**
50- * Add Vite's HMR client to the block editor.
51- *
52- * @return void
53- */
54- add_action ('enqueue_block_assets ' , function () {
55- if (! is_admin () || ! get_current_screen ()?->is_block_editor()) {
56- return ;
57- }
58-
59- if (! Vite::isRunningHot ()) {
60- return ;
61- }
62-
63- $ script = sprintf (
64- <<<'JS'
65- window.__vite_client_url = '%s';
66-
67- window.self !== window.top && document.head.appendChild(
68- Object.assign(document.createElement('script'), { type: 'module', src: '%s' })
69- );
70- JS,
71- untrailingslashit (Vite::asset ('' )),
72- Vite::asset ('@vite/client ' )
73- );
74-
75- wp_add_inline_script ('wp-blocks ' , $ script );
76- });
77-
7849/**
7950 * Use the generated theme.json file.
8051 *
You can’t perform that action at this time.
0 commit comments