Skip to content

Commit

Permalink
fix: version assets correctly
Browse files Browse the repository at this point in the history
fixes #210
  • Loading branch information
bporcelli committed Oct 11, 2023
1 parent 85d41a4 commit d4a0b45
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions includes/class-sst-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,11 @@ public function register_admin_assets() {
* @param string $context Context to register assets for. Can be 'admin' or 'frontend'.
*/
private function register_assets_for_context( $context ) {
$js_base_url = SST()->url( 'assets/js/' );
$css_base_url = SST()->url( 'assets/css/' );
$load_minified = ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG;
$defaults = array(
$js_base_url = SST()->url( 'assets/js/' );
$css_base_url = SST()->url( 'assets/css/' );
$plugin_version = SST()->version;
$load_minified = ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG;
$defaults = array(
'type' => '',
'file' => '',
'compressed' => false,
Expand All @@ -273,7 +274,7 @@ private function register_assets_for_context( $context ) {
foreach ( $this->assets as $handle => $asset ) {
$asset = wp_parse_args( $asset, $defaults );
$options = $asset['options'];
$ver = isset( $options['ver'] ) ? $options['ver'] : false;
$ver = $options['ver'] ?? $plugin_version;
$deps = array();

if ( isset( $options['deps'] ) ) {
Expand Down

0 comments on commit d4a0b45

Please # to comment.