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 4949 ])->toHtml ();
5050});
5151
52- /**
53- * Add Vite's HMR client to the block editor.
54- *
55- * @return void
56- */
57- add_action ('enqueue_block_assets ' , function () {
58- if (! is_admin () || ! get_current_screen ()?->is_block_editor()) {
59- return ;
60- }
61-
62- if (! Vite::isRunningHot ()) {
63- return ;
64- }
65-
66- $ script = sprintf (
67- <<<'JS'
68- window.__vite_client_url = '%s';
69-
70- window.self !== window.top && document.head.appendChild(
71- Object.assign(document.createElement('script'), { type: 'module', src: '%s' })
72- );
73- JS,
74- untrailingslashit (Vite::asset ('' )),
75- Vite::asset ('@vite/client ' )
76- );
77-
78- wp_add_inline_script ('wp-blocks ' , $ script );
79- });
80-
8152/**
8253 * Use the generated theme.json file.
8354 *
You can’t perform that action at this time.
0 commit comments