Skip to content

Commit bc4eebc

Browse files
committed
fix (Assets): move inline script
1 parent 7013acc commit bc4eebc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

inc/Services/Assets.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ public function register_assets(): void {
7171
true
7272
);
7373

74+
wp_add_inline_script(
75+
'scripts',
76+
'const THEME_DATA = ' . wp_json_encode(
77+
[
78+
'themeUri' => get_template_directory_uri(),
79+
]
80+
),
81+
);
82+
7483
// CSS
7584
wp_register_style( 'theme-style', get_stylesheet_uri(), [], $version );
7685
}
@@ -81,15 +90,6 @@ public function register_assets(): void {
8190
public function enqueue_scripts(): void {
8291
// JS
8392
$this->assets_tools->enqueue_script( 'scripts' );
84-
85-
wp_add_inline_script(
86-
'scripts',
87-
'const THEME_DATA = ' . wp_json_encode(
88-
[
89-
'themeUri' => get_template_directory_uri(),
90-
]
91-
),
92-
);
9393
}
9494

9595
/**

0 commit comments

Comments
 (0)