Skip to content

Commit

Permalink
Merge pull request #1352 from emaildano/patch-2
Browse files Browse the repository at this point in the history
Handle $dist_path as var
  • Loading branch information
retlehs committed Mar 3, 2015
2 parents f0d825b + 6cc7b7f commit 6a9e437
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ public function getPath($key = '', $default = null) {
}

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);
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -171,4 +172,3 @@ function ga() {
if (GOOGLE_ANALYTICS_ID) {
add_action('wp_footer', __NAMESPACE__ . '\\google_analytics', 20);
}

0 comments on commit 6a9e437

Please sign in to comment.