Skip to content

Commit

Permalink
Merge pull request #14 from newfold-labs/PRESS4-306
Browse files Browse the repository at this point in the history
Provide more flexibility when loading runtime JS
  • Loading branch information
wpscholar authored Oct 5, 2023
2 parents 5b88eef + e67ed9d commit 55e1b1a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion includes/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,14 @@ public function prepareRuntime() {
* Load Runtime into the page.
*/
public function register_runtime() {
\wp_register_script(
'nfd-runtime',
null,
null,
$wp_version
);
\wp_add_inline_script(
$this->container->plugin()->id . '-script',
'nfd-runtime',
'window.NewfoldRuntime =' . wp_json_encode( $this->prepareRuntime( $this->container ) ) . ';',
'before'
);
Expand Down

0 comments on commit 55e1b1a

Please sign in to comment.