Skip to content

Commit

Permalink
Merge pull request #7 from catgofire/patch-1
Browse files Browse the repository at this point in the history
Update for new Sage 10 directory structure
  • Loading branch information
MWDelaney authored Feb 1, 2021
2 parents ea7e0a0 + c88b4cb commit 96d2129
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions advanced-custom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@
if (is_dir(get_stylesheet_directory() . '/assets')) {
// This is Sage 9
$path = get_stylesheet_directory() . '/assets/acf-json';
} else {
// This is Sage 10
} elseif (is_dir(get_stylesheet_directory() . '/resources/assets')) {
// This is old Sage 10
$path = get_stylesheet_directory() . '/resources/assets/acf-json';
} elseif (is_dir(get_stylesheet_directory() . '/resources')) {
// This is Sage 10
$path = get_stylesheet_directory() . '/resources/acf-json';
} else {
// This probably isn't Sage
$path = get_stylesheet_directory() . '/acf-json';
}

// If the directory doesn't exist, create it.
Expand All @@ -48,9 +54,15 @@
// Sage 9 path
$paths[] = get_stylesheet_directory() . '/assets/acf-json';

// Sage 10 path
// old Sage 10 path
$paths[] = get_stylesheet_directory() . '/resources/assets/acf-json';

// Sage 10 path
$paths[] = get_stylesheet_directory() . '/resources/acf-json';

// Failsafe path
$paths[] = get_stylesheet_directory() . '/acf-json';

// return
return $paths;
});
Expand Down

0 comments on commit 96d2129

Please sign in to comment.