Merge pull request #1352 from emaildano/patch-2
Handle $dist_path as var
This commit is contained in:
@@ -53,13 +53,14 @@ class JsonManifest {
|
||||
}
|
||||
|
||||
function asset_path($filename) {
|
||||
$dist_path = get_template_directory_uri() . '/dist/';
|
||||
$dist_dir = '/dist/';
|
||||
$dist_path = get_template_directory_uri() . $dist_dir;
|
||||
$directory = dirname($filename) . '/';
|
||||
$file = basename($filename);
|
||||
static $manifest;
|
||||
|
||||
if (empty($manifest)) {
|
||||
$manifest_path = get_template_directory() . '/dist/assets.json';
|
||||
$manifest_path = get_template_directory() . $dist_dir . 'assets.json';
|
||||
$manifest = new JsonManifest($manifest_path);
|
||||
}
|
||||
|
||||
@@ -130,7 +131,7 @@ function jquery_local_fallback($src, $handle = null) {
|
||||
static $add_jquery_fallback = false;
|
||||
|
||||
if ($add_jquery_fallback) {
|
||||
echo '<script>window.jQuery || document.write(\'<script src="' . get_template_directory_uri() . '/dist/scripts/jquery.js"><\/script>\')</script>' . "\n";
|
||||
echo '<script>window.jQuery || document.write(\'<script src="' . get_template_directory_uri() . $dist_dir . 'scripts/jquery.js"><\/script>\')</script>' . "\n";
|
||||
$add_jquery_fallback = false;
|
||||
}
|
||||
|
||||
@@ -171,4 +172,3 @@ function google_analytics() {
|
||||
if (GOOGLE_ANALYTICS_ID) {
|
||||
add_action('wp_footer', __NAMESPACE__ . '\\google_analytics', 20);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user