File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,29 @@ function get()
36
36
{
37
37
$ theme = get_stylesheet_directory ();
38
38
39
- $ default = file_exists ($ theme . '/config/ ' ) ?
39
+ /**
40
+ * Sage once included `style.css`under directory resources
41
+ * which makes `$theme` incorrectly point to `resources/config`
42
+ * resulting in the config file not being found. Searching
43
+ * for `resources` and changing to the parent directory fixes
44
+ * the issue
45
+ */
46
+ $ matchpos = strpos ($ theme , '/resources ' );
47
+ $ match = $ matchpos && strpos ($ theme , 'resources ' ) + strlen ('resources ' ) === strlen ($ theme );
48
+
49
+ if ($ match ) {
50
+ $ theme = dirname (get_stylesheet_directory ());
51
+ }
52
+
53
+ $ config = file_exists ($ theme . '/config/ ' ) ?
40
54
$ theme . '/config/intervention.php ' :
41
55
$ theme . '/intervention.php ' ;
42
56
57
+ /*
43
58
$config = has_filter('sober/intervention/return') ?
44
59
apply_filters('sober/intervention/return', rtrim($default)) :
45
60
$default;
61
+ */
46
62
47
63
if (!file_exists ($ config )) {
48
64
return ;
You can’t perform that action at this time.
0 commit comments