Skip to content

Commit

Permalink
Merge branch 'pr/60' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Twansparant committed Dec 5, 2023
2 parents 9a9e3a4 + 04d838c commit 64bb0db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/wpackio/enqueue/inc/Enqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ private function sanitize_path( $path ) {
public function printPublicPath() {
$publicPath = apply_filters( 'wpackio_print_public_path', $this->getUrl( '' ), $this->appName, $this->outputPath );
$jsCode = 'window.__wpackIo' . $this->sanitize_path( $this->appName . $this->outputPath ) . '=\'' . esc_js( $publicPath ) . '\';';
echo '<script type="text/javascript">/* wpack.io publicPath */' . $jsCode . '</script>';

// Enqueue an empty script so we can add an inline script that allows for filtering via `wp_inline_script_attributes`
\wp_register_script("{$this->appName}/publicPath", '', [], false, true);
\wp_enqueue_script("{$this->appName}/publicPath");
\wp_add_inline_script("{$this->appName}/publicPath", "/* wpack.io publicPath */ {$jsCode}");
}

/**
Expand Down
1 change: 0 additions & 1 deletion responsive-pics.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class ResponsivePicsWP
{
private static $instance;
public static $enqueue;

public $api;
public $helpers;
public $error;
Expand Down

0 comments on commit 64bb0db

Please sign in to comment.