Skip to content

Commit

Permalink
Avoid use of theme constants
Browse files Browse the repository at this point in the history
  • Loading branch information
atanas-dev committed May 2, 2020
1 parent 6bf0eea commit a9fd199
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Assets/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function getAssetUri( $asset ) {
return '';
}

return $this->getThemeUri() . '/' . APP_DIST_DIR_NAME . '/' . $path;
return $this->getThemeUri() . '/dist/' . $path;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Assets/Manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Manifest {
* {@inheritDoc}
*/
protected function getJsonPath() {
return APP_DIST_DIR . 'manifest.json';
return get_template_directory() . DIRECTORY_SEPARATOR . 'dist' . DIRECTORY_SEPARATOR . 'manifest.json';
}

/**
Expand All @@ -33,5 +33,7 @@ protected function load( $file ) {
} catch ( JsonFileNotFoundException $e ) {
// We used to throw an exception here but it just causes confusion for new users.
}

return [];
}
}
2 changes: 1 addition & 1 deletion src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class Config {
* {@inheritDoc}
*/
protected function getJsonPath() {
return APP_DIR . 'config.json';
return get_template_directory() . DIRECTORY_SEPARATOR . 'config.json';
}
}

0 comments on commit a9fd199

Please sign in to comment.