Skip to content

Commit 46f666f

Browse files
committed
FIX: prevent errors in Assets Loader
1 parent 9095f81 commit 46f666f

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

cherry-core.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* Class Cherry Core
4-
* Version: 1.5.3
4+
* Version: 1.5.4
55
*
66
* @package Cherry_Framework
77
* @subpackage Class

modules/cherry5-assets-loader/cherry5-assets-loader.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ class Cherry5_Assets_Loader {
7474
*/
7575
public static $initialized = false;
7676

77+
/**
78+
* Module directory path.
79+
*
80+
* @since 1.5.0
81+
* @var srting.
82+
*/
83+
public static $module_path = null;
84+
7785
/**
7886
* Class constructor.
7987
*
@@ -83,7 +91,8 @@ class Cherry5_Assets_Loader {
8391
*/
8492
public function __construct( $core = null, $args = array() ) {
8593

86-
$this->args = $args;
94+
self::$module_path = $args['module_path'];
95+
$this->args = $args;
8796
$this->init();
8897

8998
if ( ! empty( $this->args['css'] ) && is_array( $this->args['css'] ) ) {

modules/cherry5-assets-loader/inc/cherry5-assets-loader-handle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function print_tags_var() {
9090
return;
9191
}
9292

93-
$path = preg_replace( '/[\\\\\/]inc$/', '/assets/var.js', $this->module_path );
93+
$path = Cherry5_Assets_Loader::$module_path . 'assets/var.js';
9494

9595
ob_start();
9696
include $path;

0 commit comments

Comments
 (0)